Forum Discussion
James_Ramsey_10
Nimbostratus
May 31, 2007maintenance
I would like to setup an rule to send all traffic to http://maintenance.mysite.com from a virtual server when all 6 pools are down. Could anyone help me out?
Thanks
- JRahm
Admin
Would the fallback host option in the http profile not work for you? - James_Ramsey_10
Nimbostratus
Not sure, how would that work? Here is an example. We do maintenace one very few weeks. I have 6 pools. I would like to force fail the pools, and then send all the requests to another URL. Once we are done with maintenance, I would like to un-fail, and allow traffic back to the 6 pools. - You can always get the number of active members in the current pool with the active_members command. Something like this should work for you...
when HTTP_REQUEST { if { 0 == [active_members [LB::server pool]] } { HTTP::redirect "http://backup_domain/maintenance.html" } }
http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=66
Click here - James_Ramsey_10
Nimbostratus
This works great, but I just need one more question answered. I have around 500 pools, how do i set a redirect based off the domain. I don't really want to create 1 rule for each pool. - It's your lucky day, I think the domain command is just what you need!
http://devcentral.f5.com/wiki/default.aspx/iRules/domain.html
Click herewhen HTTP_REQUEST { if { 0 == [active_members [LB::server pool]] } { set dom [domain [HTTP::host] 2] HTTP::redirect "http://maintenance.${dom}" } }
when HTTP_REQUEST { if { 0 == [active_members [LB::server pool]] } { HTTP::redirect "http://maintenance.[domain [HTTP::host] 2]" } }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects