Hi ,
I have a VIP with multiple application (DNS) pointed to one single VIP. The pool selection made based on hostname as in irule below.
I want to add rule to get maintenance page if a specific pool goes down. Kindly help what all options can be choose or share irule which can be used.
We will create if event inside switch. Please try & update if any issue.
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"abc.bbc.com" {
if { [active_members pool_1] < 1 } {
HTTP::redirect "https://www.maintenance.com[HTTP::uri]" }
elseif { pool pool_1 }
}
"xyz.bbc.com" {
if { [active_members pool_2] < 1 } {
HTTP::redirect "https://www.maintenance.com[HTTP::uri]" }
elseif { pool pool_2 }
}
}
}
Hi F5_rock,
I used below irule. maintance page works fine but with below error. The page doesnt load proper may be because the uri trying is in CAPS and LB is not changing to lower it.
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"services.com" {
SSL::disable serverside
if { [active_members pool-http] eq 0 } {
HTTP::path "/maintenance/ServerMaintenance.htm"
pool maintenance-pool
} {
HTTP::path "/xyz"
pool services-pool-http
}
}
Tried this but no help
Hello Habib,
Replace the line
HTTP::path "/maintenance/ServerMaintenance.htm"
by
HTTP::uri "/maintenance/ServerMaintenance.htm"
Not sure this will resolve your issue but just to correct it
Regards