Forum Discussion
skravens_86061
Jan 21, 2011Nimbostratus
adding a redirect to a maintenance page HTML code
Can you place "another" redirect inside the HTML code of a Maintenace page? This page goes up when the servers are not available, then after 10 seconds or so it redirects to a different IP or server. Anyone have experience with this?
Thank you
- Chris_MillerAltostratusThis thread should help.
- skravens_86061Nimbostratus
That isexactly what I am looking for!!!!!
Thanks a bunch Chris!
- skravens_86061NimbostratusChris,
< when HTTP_REQUEST { if { [TCP::local_port] eq "80" } { persist source_addr 60 HTTP::fallback http://support.com/ set dtime 5 Un-comment the next 3 lines for redirects and expand out with elseif's if needed if { [HTTP::host] == "www.qa-dognet.org" } { HTTP::respond 200 content \ " \We are sorry, but the site you are looking for is temporarily out of service." "Content-Type" "text/html" } else { pool DMX-POOL Un-comment the net line if using redirects } } elseif { [TCP::local_port] eq "8443" } { HTTP::header insert "BPL-SSL" "On" pool DMX-POOL } else { set srvr [findclass [TCP::local_port] $::Individual_Servers " "] if { $srvr ne "" } { node $srvr 80 } else { Replace with the default URL of the site HTTP::redirect "" } } }
- Chris_MillerAltostratusThe example I posted in the other thread was for a user with a fairly complicated iRule already setup. Can you help me understand the exact situation in which you'd like the redirect/holding page to be presented? Is it simply if there are no active members in your pool? If so, you'd like the maintenance page to hold the user for 10 seconds? After the 10 seconds, where would you like them to go?
- skravens_86061NimbostratusOk , We would like users to go to a dummy VS (HTTPS://dognet.org) which will have no active members in it (DMX-Pool), from there they will get the holding page 10secs, then get redirected to the 192.168.XXX.X address.
- Chris_MillerAltostratusThe rule below will check whether there are any active members in the DMX-Pool. If there are none, it'll redirect to http://192.168.xxx.x/ after holding the user at the maintenance page for 10 seconds.
when HTTP_REQUEST { if { [active_members DMX-Pool] < 1 } { set dtime 6 HTTP::respond 200 content \ "Apology page\ We are sorry, but the site you are looking for is temporarily out of service." "Content-Type" "text/html" } }
- skravens_86061Nimbostratus
Wow Dude, you must work with these F5s alot.
Thanks for the quick response, will go try it out.
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