Forum Discussion
DarkSideOfTheQ_
Nimbostratus
Jul 14, 2010Return status code and a retry after X value
Hello All,
I was asked today to create an iRule that returned a 503 based off the user-agent string and also a return value of some sort. I have my iRule that will give the 503 but can't qui...
hoolio
Cirrostratus
Jul 14, 2010Hi DarkSide,
You can use HTTP::respond to send a specific response code and append a list of header names and values. I think something like this should work:
when HTTP_REQUEST {
Check if the User-Agent header
if {[HTTP::header User-Agent] contains "some user-agent string"}{
Send a 503 response with a Retry-After header set to 5 minutes
Don't include the Server: BigIP header (noserver)
Retry-After described in: http://tools.ietf.org/html/rfc2616section-14.37
HTTP::respond 503 noserver "Retry-After" 300
}
}
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