Forum Discussion
Moreli_Alama_63
Nimbostratus
May 14, 2007irule for 503 response to client
hi
i have a http VIP and am wanting to create a 503 response to the client
when the VIP is unavailable. how does one achieve this? i can see you can assign
monitors to pools but nothing jumps about how an irule or action is invoked
when the http monitor is down.
your help appreciated.
m
- Derek_21908
Nimbostratus
To issue a redirect when the pool is down, specify a Fallback Host in the HTTP profile. - Bruno_12199
Nimbostratus
+1 : it seems that a public web site must return a 503 error page instead of a 302 (as the BigIP does), because 302 are followed by bots, which means that a maintenance period can ruin some rankings. - hoolio
Cirrostratus
In a simple test on 9.4.6, I was able to send a 503 with content using HTTP::respond. I've also used a 503 in 9.2.4 and 9.3.1. I'm not sure if it was a bug in an older version or a configuration issue. But if you're seeing a problem with sending a 503, can you post the iRule you're testing and the results of the tests?when HTTP_REQUEST { set data {Some data to send to the client. If you want to use variables in here, replace the curly braces with quotes.} Look for a URI starting with a forward slash and then 3 digits (the first digit being 1-5) If one is found, set it as the HTTP response code. Else, send back an HTTP 200 if {[string match {/[1-5][0-9][0-9]*} [HTTP::path]]}{ Send the response with the status code from the requested path and data HTTP::respond [string range [HTTP::path] 1 3] content $data "a_header_name" "a_header_value" log local0. "Sending [string range [HTTP::path] 1 3] response with $data" } else { Send a 200 response with data HTTP::respond 200 content $data "a_header_name" "a_header_value" log local0. "Sending default 200 response with $data" } }
- Bruno_12199
Nimbostratus
Tx for the quick reply. In the mean time, we managed to have the fallback host respond with a 503 code, which would solve the mentioned problem (plus an additional in the HTML code). Nevertheless, I keep a bookmark on this iRule, and I'll let you know if/when I need to put it in place.
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