Forum Discussion
Parveez_70209
Nimbostratus
May 08, 20155xx response code error Irule issue
Hi Team,
I have below Irule in place which is working for me based on 503 response but which is restricted to "pool-test_shop.kpr.com_http".
when CLIENT_ACCEPTED {
set count 0
}
wh...
May 09, 2015
I think you should try to make this a bit clearer.
I've rewritten your original rule in a nicer formatting in case someone else understood the initial description:
when CLIENT_ACCEPTED {
set count 0
}
when HTTP_REQUEST priority 800 {
set request [HTTP::request]
}
when LB_SELECTED {
if { $count >= 1 } {
log local0. "Deleting cookie 73686f706c656e6f766f with value \"[HTTP::cookie value 73686f706c656e6f766f]\""
HTTP::cookie remove "73686f706c656e6f766f"
LB::reselect pool pool-test_shop.kpr.com_http
log local0. "Reselection: member [LB::server addr]:[LB::server port] from pool [LB::server pool]"
}
}
when HTTP_RESPONSE priority 800 {
if { [HTTP::status] eq 503 && $count < 3 && [LB::server pool] == "pool-test_shop.kpr.com_http"} {
incr count
HTTP::retry $request
log local0. "[HTTP::status] from [LB::server addr]:[LB::server port], trying another [LB::server pool] member (retry $count)"
} elseif { [HTTP::status] == 503 && $count >= 3 } {
HTTP::redirect "http://www.kpr.com"
set count 0
log local0. "Redirect to dotcom due to panic mode (retried pool [LB::server pool] $count times)"
} elseif { ! ( [HTTP::status] eq 503 ) && $count >= 1 && [LB::server pool] == "pool-test_shop.kpr.com_http" } {
set count 0
} elseif { $count >= 1 && ! ( [LB::server pool] == "pool-test_shop.kpr.com_http" ) } {
log local0. "Retry count = $count for pool [LB::server pool] -- this connection is being reused"
}
}
/Patrik
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