Forum Discussion
leon_107471
Nimbostratus
Jan 12, 2008HTTP_RESPONSE codes
Hi
Can someone help me translate the below irule to the correct irule syntax?
Thanks in advance
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "1, 3, 4 ,5" } {
LB::down
}
}
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "2" } {
LB::up
}
}
1 Reply
- hoolio
Cirrostratus
That should work to mark a pool member as down if the response code isn't a 200. However, there are many instances where a web server could legitimately reply with a non-200 response. Take a look at the HTTP 1.1 RFC's section on response codes for examples:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
You might be better off looking only for 50x errors, as these indicate a server-side error. You might also want to select a new nodewhen HTTP_RESPONSE { if {[HTTP::status] starts_with {5}}{ LB::down } }
You could also look into reselecting a new pool member if the request does generate a 5xx response, using LB::reselect.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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