Forum Discussion
5 Replies
- ArieAltostratus
You could store the HTML in a file on the LTM, or you can simply embed the HTML in an iRule. The latter is the easier method. If you need images etc. on the page you could store those also, but it's a lot easier if they're hosted on a CDN or non-affected system.
Another option is to host the page on a (set of) web server(s) and set up a pool/nodes for it.
- Jay_05_143988Nimbostratus
currently this is for a development system that the client does not want everyone going to. So currently no systems we can mess with.
If I understand the script when HTTP_REQUEST { if { ( [IP::addr [IP::client_addr] equals 10.1.1.1] ) or ( [IP::addr [IP::client_addr] equals 10.1.1.2] ) } { HTTP::redirect "http://10.200.200.200" } } When redirecting how would I point to the LTM
Sorry not real familiar but thrown into this.
- IheartF5_45022Nacreous
When 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" }
- Daniel2010_1501Nimbostratus
Wrote a simple iRule to redirect to an external webserver's maintenance page when all nodes in the pool are unavailable. The original iRule that we modified to create the iRule below is from https://devcentral.f5.com/questions/redirect-based-on-monitor-status
Hope this help you guys also.
when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0 } { HTTP::redirect "http://maintenance.host.url/dir/dir/file" } }
- Joe_5599_134300Nimbostratus
Simple maintenance page irule that includes the message in the irule. I was able to get this working on my lab box. Add to your VS then disable all pool members to test.
when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0 } { set http_reply "You have reached [HTTP::host],
} }