Domai
Altostratus
Apr 12, 2016iRule help
Hello Guys,
Quick question and need help with the iRule below. The goal is to setup an apology page when the all the pool members are down. so using the iRule below (Thank you nitass) ...
Hi
You could either send your clients a redirect back to /apology (or some other) or you just need to change your logic slightly so that you are not looking for an absolute path. Something like this might work
when HTTP_REQUEST {
if {[active_members [LB::server pool]] < 1} {
if { [HTTP::uri] eq "/apology_pic"} {
HTTP::respond 200 content [ifile get "apology_pic"] }
else {
HTTP::respond 200 content [ifile get "apology"] }
}
}
So with this code you are checking for pool availability first, if the pool is down and the call is for /apology_pic then the iRule will serve the iFile, otherwise the holding page iFile gets served. This way the uri doesn't change in the browser and so if someone refreshes and your pool becomes available again then they should be able to carry on browsing