Forum Discussion

Domai's avatar
Domai
Icon for Altostratus rankAltostratus
Apr 12, 2016

iRule assist - Apology page

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)

 

========================================================================

 

when HTTP_REQUEST { if {[active_members [LB::server pool]] < 1} {

 

switch [HTTP::uri] {

 

"/" { HTTP::respond 200 content [ifile get "apology"] }

 

"/apology_pic" { HTTP::respond 200 content [ifile get "apology_pic"] }

 

}

 

}

 

}

 

========================================================================

 

So when the user goes to and the pool members down the page is displayed fine. But lets say if the user is a smartypants and knows his vir dir and types in -

 

www.site.com/getstatus.aspx then the apology page does not come up. Looking at the above rule I assumed that switch [HTTP::uri] will handel this...Am I wrong? How do I fix the above iRule?