Forum Discussion
Jay_05_143988
Nimbostratus
Feb 12, 2014Redirect to a maintenance page on the F5
Ok so my client needs to redirect based on a range of IP address back to a page on the F5 during maintenance times.
I saw how to redirect to another IP back can the F5 host one html page?
IheartF5_45022
Nacreous
Feb 12, 2014When the site owners don't want to redirect to an external site, we store an html file with embedded images/js in a datagroup in the F5. We get the content from the site owners, then gzip it, then b64encode it
when LB_FAILED {
Respond with sorry page
HTTP::respond 503 Content [b64decode [class lookup "/sorry/sorry_prod.htm" dg_html_content]] noserver Content-Type "text/html" Retry-After "600" Content-Encoding "gzip" Connection "close"
}
I'm afraid clients which don't accept compression get an ugly response, however if you do want to cater for them and you have some content that is compressed and some that isn't;-
set res [class lookup $sorry dg_html_content]
if {[HTTP::header Accept-Encoding] contains "gzip" && $res starts_with "H4sI"} {
HTTP::respond 503 content [b64decode $res] noserver Content-Type "text/html" Retry-After "600" Content-Encoding "gzip" Connection "close"
} else {
They don't support gzip
HTTP::respond 503 content [b64decode $res] noserver Content-Type "text/html" Retry-After "600" Connection "close"
}
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