Forum Discussion
dave_20485
Nimbostratus
Aug 05, 2010Triggering a holding page for all virtual servers
Hi there,
I've been searching around the forums looking for an answer to this Q, and haven't found it, but if there is already a posted solution then please point me in the direction of it.....
hoolio
Cirrostratus
Aug 05, 2010Hi Dave,
In order to have an iRule take effect on all virtual servers, the iRule would need to be applied to all virtual servers. I think your initial thought on a single iRule which is applied to all VS's that checks for a value in a datagroup would be a good way to implement this. Here is a simple, untested example:
when HTTP_REQUEST {
Check if the global_maintenance_class's single name is 1 or 0
if {[class element -name 0 global_maintenance_class] == 1}{
Send the maintenance HTML with cache control headers set to prevent caching
HTTP::respond 200 content {maintenance info here} Cache-Control No-Cache Pragma No-Cache
}
}
It would be most efficient to only add this iRule when you want to send the maintenance response. Else, you'd need to do a datagroup lookup on every HTTP request to every VS. You could create a simple iControl app which adds the iRule to all VS's that is run either from a remote host or the LTM unit itself.
You could expand on this to example to serve HTML and images which the HTML reference. See the maintenance page examples in the Codeshare for details:
http://devcentral.f5.com/wiki/default.aspx/iRules/CodeShare.htmlUtility
(search for maintenance)
Aaron
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