Forum Discussion
iRule to redirect to another VIP if all pool members are down
I tried to manipulate it. Please check if it works for you.
when HTTP_REQUEST {
if { [HTTP::host] equals "abc.com" and { if { [active_members abc_POOL] == 0 }
}} {
HTTP::redirect "https://redirect.com"
}
if { [HTTP::host] equals "xyz.com" and { if { [active_members xyz_POOL] == 0 }
}} {
HTTP::redirect "https://redirect.com"
}
}
- asamosaadMar 04, 2020
Nimbostratus
I will diffidently try it and will let you know if it works.
I have also made this one using the of google, what do you think about it?
when HTTP_REQUEST {
if {[active_members [LB::server pool]] == 0 } {
if {(([string tolower [HTTP::host]] equals "abc.com") ||
([string tolower [HTTP::host]] equals "xyz.com") ||
([string tolower [HTTP::host]] contains "example"))
HTTP::redirect "https://redirect.com"
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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