Forum Discussion
kaliprasad02_16
Nimbostratus
Jun 23, 2014IRULE to redirect the traffic to a under_maintenance.htm
Hi,
I would like to know how to setup an IRule which will redirect all the HTTP/HTTPS traffic to URL(say under_maintenance.htm) when we make websites down for maintenance activities.
Also,...
Kevin_Stewart
Employee
Jun 24, 2014There are a few additional options to consider:
-
Fallback Host: Inside the HTTP profile is an option called Fallback Host. This option, when defined, will send a 302 redirect to the specified address if all pool members are down. No iRules needed.
-
active_members check: a simple active_members check of the pool and then whatever you need to happen if all members are down:
when CLIENT_ACCEPTED { set default_pool [LB::server pool] } when HTTP_REQUEST { if { [active_members $default_pool] < 1 } { send a redirect or output HTML content here } } -
Time-based outage: based on the following post:
https://devcentral.f5.com/questions/irule-to-disable-a-pool-to-new-connections
when RULE_INIT { set static::START_OFF_TIME "Saturday 09:00 AM" set static::END_OFF_TIME "Saturday 11:00 AM" } when HTTP_REQUEST { set start_off_time [clock scan $static::START_OFF_TIME] set end_off_time [clock scan $static::END_OFF_TIME] set now [clock seconds] if { ( [expr $now > $start_off_time] ) and ( [expr $now < $end_off_time] ) } { HTTP::respond 200 content "Maintenance ModeMaintenance mode..." } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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