Forum Discussion
hooleylist
Jan 09, 2014Cirrostratus
thibino is correct that iRule changes only take effect on new connections.
You could leave the iRule enabled at all times, but use a data group to store an on|off value. The iRule would use the class command to check the data group key to see if non-GET requests should be blocked.
https://devcentral.f5.com/wiki/iRules.class.ashx
when HTTP_REQUEST {
Check if the maintenance key is set to on in the maint_dg datagroup
if {[class lookup "maintenance" maint_dg] eq "on"}{
Check if this is not a GET request
if {not ([HTTP::method] eq "GET")}{
Send an HTTP response with cache control headers set to not cache the response
HTTP::respond 200 content {Please retry your request later. Maintenance!} Connection Close Cache-Control No-Cache Pragma No-Cache
}
}
}
Aaron