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...
DarkSideOfTheQ_
Nimbostratus
Jul 15, 2010Hi Hoolio,
I appreciate the assistance. I wasn't sure about appending the "Retry-After" header after I had the 503 in there. I had to modify the Retry-After part as it wouldn't accept it (I'm running 9.2.4 if that makes a difference?)
Here is what I got working if someone comes across the need for something like this as I did.
when HTTP_REQUEST {
Check the User-Agent header
switch -glob [string tolower [HTTP::header User-Agent]] {
"*msnbot*" -
"*fast-*" -
"*yahoo-newscrawler*" -
"*baiduspider*" -
"*google*" {
Send a 503 response with a Retry-After header set to 3 hours
Don't include the Server: BigIP header (noserver)
HTTP::respond 503 noserver Retry-After:10800
}
}
}
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