Forum Discussion
Narendra_26827
Jul 11, 2011Nimbostratus
Thanks Michael/Aaron/Colin for your kind suggestions.
I have created a iRule like below to redirect the requests to different pool if a node sends http 404. Persistence is enabled at request, if http 404 comes it can break the persistence (i think it will work without that also) and redirect to another pool.
when CLIENT_ACCEPTED {
set retries 0
}
when HTTP_REQUEST {
persist source_addr
set request_headers [HTTP::request]
}
when LB_SELECTED {
if { $retries > 0 } {
persist none
LB::reselect pool Sample_Pool_1
}
}
when HTTP_RESPONSE {
if { $request_headers ne "" && $retries < [active_members [LB::server pool]] } {
switch [HTTP::status] {
404 {
incr retries
HTTP::retry $request_headers
}
}
}
}