Forum Discussion
Maintenance page iRule. Need redirect AND rewrite.
- Aug 22, 2014
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.
I've been looking through your suggestion and working with Nitass' code. I was able to host the site on the LTM and get it to come up when all of the pool members come up, without images. Ideally, I would like to do this. Redirect to maint.xyz.com and replace the URL with www.xyz.com. Our maintenance pages often change so ideally I would redirect to a server with the maint page instead of having to recreate an irule every time the devs have to update the page. Of course the rewrite doesn't work.
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"
HTTP::header replace Host "www.xyz.com"
}
}
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com