Forum Discussion
Help with L7 Irule with maintenance redirect when pool is down
I am very new to Irules and I am trying to create a L7 header redirection Irule with a maintenance page redirection if the particular pool is down. This should be possible, but I am having issues getting it to work.
Right now I have 2 Irules applied to the VIP and I want to combine them with different redirects based on the Pool.
Irule 1 Layer7 redirection when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
L7 Header Redirection
"productA.com" { pool productA-pool }
"productB.com" { pool productB-pool }
"productC.com" {pool productC-pool}
Irule 2 Maintenance redirection
when HTTP_REQUEST {
set VSPool [LB::server pool]
if { [active_members $VSPool] < 1 } {
HTTP::redirect "http://www.maintenance.com"
}
}
This current setup works great if I want to send them to generic maintenance page. But now I'd like each pool to have their own maintenance redirect that more specific to the website. Example if productA-pool is down, redirect to productB-pool is down, redirect to etc.
I believe this can be done, but I can't seem to get my logic down in the Irule.
Any help with making this work would be appreciated.
thanks!
1 Reply
- Josiah_39459Historic F5 Account
Instead of setting the pool you check to be the default pool (set VSPool [LB::server pool]), set it to the be the pool based on host using the same logic you have for the pool command (can probably set the variable in the same switch even.
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