Forum Discussion
KJ_50941
Nimbostratus
Sep 21, 2015iRules when pool member is down
I used below irule so if both pool members failed then F5 iRule due redirect to another page which is hosting on another server.
when HTTP_REQUEST {
if { [active_members My_APACHE_SAT_8443_Pool ...
THi
Nimbostratus
Sep 21, 2015Syntactically you can also use nested if statements:
when HTTP_REQUEST {
if { [active_members My_APACHE_SAT_8443_Pool] < 1 } {
HTTP::redirect http://example-test.com/
} else {
if { [HTTP::uri] eq "/" } {
HTTP::redirect https://[HTTP::host]/help/html
}
}
}
Don't know the actual implementation on F5 TCL, but the former might be a bit more compact and use less CPU cycles. If needed you can add a final else, too. If you need more redirects based on the path, you might use switch statement instead of nested if.
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