Forum Discussion
Ed_Ferrageau_67
Nimbostratus
Feb 01, 2008Redirect when all poolmembers are down
Hi,
I'm trying to figure out how I can redirect a request to an "external" errorpage, when all poolmembers are down. I have no experience with iRules, so any help is more than welcome.
Thanks.
Ed
5 Replies
- hoolio
Cirrostratus
Hello,
You can do this without a rule using the fallback host on the HTTP profile associated with the virtual server. Check the LTM config guide's section on the HTTP profile for details.
Else, if you want to use an iRule, you can do so following the example in SOL7065 (Click here).
Aaron - Wil_Schultz_101
Nimbostratus
Here's one that I use:when HTTP_REQUEST { set mypool [active_members somepool] switch $mypool { "0" { HTTP::redirect "http://www.mydomain.com/maintenance.html" } default { pool mybackup_pool } } } - Ed_Ferrageau_67
Nimbostratus
Aaron, wschultz,
Thanks a lot. This was indeed what I was looking for.
Cheers.
Ed - Dave_20275
Nimbostratus
This also works to if you have no suitable external site to redirect to. I simply have the BIGIP do a content subsitution with the HTML contained in the pool_error string.
when HTTP_REQUEST {
}when RULE_INIT {
set pool_error {
No Servers Available are in the Requested Virtual Server's Pool
INSERT YOUR HTML HERE!!!
}
}
when HTTP_REQUEST {
if {[active_members your_pool_here ] < 1 } {
HTTP::respond 200 content [subst $::pool_error]
}
} - Colin_Walker_12Historic F5 AccountThat's a good point. The HTTP::respond command is extremely powerful in that it allows you to send back custom HTML content directly from the BIG-IP. It also saves you from having to send the client a redirect, which some clients will complain about, depending on their security settings.
Colin
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
