Maintenance page iRule. Need redirect AND rewrite.
Hi :)
I am looking to create an irule to throw a maintenance page redirect if our entire pool is down. This is what I have, which works.
when HTTP_REQUEST { Check if the VS default pool has no active members if { [active_members [LB::server pool]] < 1 }{ HTTP::redirect "http://maint.xyz.com" } }
The issue is, I need to be able to ALSO rewrite the url so that if the condition above is met, it redirects the user to maint.xyz.com and then rewrite their URL to www.xyz.com.
Thoughts?
Thanks!
OK, this is what i did which did the trick:
Added the maintenance server as a node on the LTM Create a pool called maintenance_pool and added my maintenance page server to it. Created an irule called maintenace_page with the following in it:
when HTTP_REQUEST { if {[active_members [LB::server pool]] < 1 } { pool maintenance_pool } }
Applied the rule to the Virtual servers needed. Voila. Works like a charm!
I really did not want to host the maintenance page on the LTM as we often change those pages and it is easier for the DEVs to do it directly on the server itself.
Thanks again for your help OTS02.