Forum Discussion
Russell_77729
Nimbostratus
Dec 24, 2012Server Maintenance Page
So I have a VS with a pool that contains only one server. I am doing SSL offload to F5. If that one server is down I would like an iRule to display as simple message saying "Sorry, this server is down for mainenance". Any help/direction would be greatly appreciated.
6 Replies
- What_Lies_Bene1
Cirrostratus
Something like this should do it;when HTTP_REQUEST { if {[active_members [LB::server pool-name-here]] < 1} { HTTP::respond 200 content "Sorry, this server is down for mainenance" noserver Content-Type "text/html" Connection "Close" Stop processing the iRule for this event here return } } - Russell_77729
Nimbostratus
Perfect. What if I was looking for something more elaborate like a full webpage with a couple of images and CSS formatted text? - What_Lies_Bene1
Cirrostratus
For extra formatting, something like this;when HTTP_REQUEST { if {[active_members [LB::server pool-name-here]] < 1} { HTTP::respond 200 content [subst { Blocking Page You got blocked buddy. Try using a valid URI, not [HTTP::uri]. } ] } } - What_Lies_Bene1
Cirrostratus
Or for css and images, using iFiles;iFiles must be uploaded in advance. Note there is no requirement to specify the file extension and thus two files cannot have the same name index is a html file, some-image is an image file, requested and sent file names do not need to match when HTTP_REQUEST { if {[active_members [LB::server pool]] < 1} { switch [HTTP::uri] { "/" { HTTP::respond 200 content [ifile get "index"] } "/some-image.jpg" { HTTP::respond 200 content [ifile get "some-image"] } } } } - Russell_77729
Nimbostratus
Awesome, thank you. - What_Lies_Bene1
Cirrostratus
You're very welcome. Merry Christmas
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