Forum Discussion
Mar 09, 2014
Hi!
Yeah, there was a space missing on the second rule and I forgot to change the event you initially posted. 🙂
Here are the revised rules. They should work:
when HTTP_REQUEST {
if { [active_members [LB::server pool]] == 0 } {
HTTP::uri "/default.html"
pool maintenance_page
}
}
when HTTP_REQUEST {
if { [active_members [LB::server pool]] == 0 } {
set uri [string tolower [HTTP::uri]]
if { not ($uri equals "/default.html" or $uri starts_with "/img/") } {
HTTP::uri "/default.html"
}
pool maintenance_page
}
}
Question: What do you actually want to achieve with the rule? Do you want a rule that you can activate manually during a maintenace window or do you want one that automatically shows information to customers if all pool members are down?
The latter can also be achieved by the fallback host in the http profile, however, not as pretty as URI rewriting since customers would get redirected and can't hit refresh to stay on the same page they were on before the pool failure.
Good luck!
Kind regards, Patrik