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 14, 2015
Hi Parveez
Since you want to run all events except LB_SELECTED when the pool is pool_testprior.levi.com I guess you can test for the two before running the logic in HTTP_RESPONSE.
Then you can do something similar in the LB_SELECTED event.
Please note that "LB::reselect pool pool-test_shop.kpr.com_http" was changed to just LB::reselect and that there's no guarantee that it will choose unique servers on all attempts as it used the load balancing method.
Try this one?
when CLIENT_ACCEPTED {
set count 0
}
when HTTP_REQUEST priority 800 {
set request [HTTP::request]
}
when LB_SELECTED {
if { $count >= 1 } {
if { [LB::server pool] != "pool_testprior.levi.com" } {
log local0. "Deleting cookie 73686f706c656e6f766f with value \"[HTTP::cookie value 73686f706c656e6f766f]\""
HTTP::cookie remove "73686f706c656e6f766f"
}
LB::reselect
log local0. "Reselection: member [LB::server addr]:[LB::server port] from pool [LB::server pool]"
}
}
when HTTP_RESPONSE priority 800 {
if { [LB::server pool] == "pool-test_shop.kpr.com_http" || [LB::server pool] == "pool_testprior.levi.com" } {
if { [HTTP::status] eq 503 && $count < 3 } {
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 } {
set count 0
} elseif { $count >= 1 } {
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