Forum Discussion
LB_FAILED iRule vs HTTP Fallback Host
Hello,
I'm working on creating a splash page for a URL which will be used as a maintenance page and a redirection for when pool members are unavailable. I've used an iRule in the past which uses the LB_FAILED event, but I have also recently looked into the fallback host within the http profile. I understand the fallback host will be triggered if no routes are present, a reset is sent, or no response is received. Please correct me if I am wrong, but wouldn't the LB_FAILED event cover those scenarios as well? Both options appear to be working great, but I'm curious if one method is preferred over the other.
iRule: when LB_FAILED { if { [active_members [LB::server pool]] < 1 } { HTTP::redirect "http://splash.page.com" } }
Thanks!
2 Replies
- sfuerst_116779Historic F5 Account
LB_FAILED occurs when the proxy fails to connect to a server in a pool.
Anything that raises an abort above the HTTP filter in the chain will trigger a HTTP fallback. This includes things like errors in iRules, Out of Memory situations, misconfiguration, and of course the proxy failing to connect.
The LB_FAILED event allows you to execute arbitrary TCL code in an iRule. You can log, you can respond, you can try a re-pick in a different pool etc. The Fallback case is much more limited, as it will only send a pre-canned response.
- Bill_Chipman_10
Nimbostratus
Thanks for this note. I was using a procedure in my HTTP_REQUEST irule to redirect to an undermaint site with arguements to show the name of the site and some error text (optional to the undermaint site). However, many of these flagged problems were being skipped and the undermaint was not appearing, until I created the fallback host entry in the HTTP profile. Interesting that the path entere in the fallback host is not used in the redirect; however my internal re-direct is working now with the query fields used by my undermaint site.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com