Forum Discussion
hooleylist
Cirrostratus
Oct 21, 2008In order to work, the URI you check for in the Referer header and what you set the URI should be the same value in both places in the rule. And it should be different from normal pages that a user would request (so not something like "/" or "index.htm"). Can you test by renaming the maintenance page on the sorry pool server to something like /maintenanace.htm and use the rule below with more logging?
Also, there was an error in your example from a missing period in the syslog facility (log local "...") which generated the TCL error in the logs.
when LB_FAILED {
log local0. "[IP::client_addr]:[TCP::client_port]: Request for [HTTP::uri] from [HTTP::header Referer] to pool failed, [LB::server pool]"
Check if this request was not generated from the maintenance page using the HTTP referer header
if {not ([HTTP::header value referer] ends_with "/maintenance.htm")}{
log local0. "[IP::client_addr]:[TCP::client_port]: Referer wasn't the maintenance page. Rewriting URI to maintenance page."
HTTP::uri "/maintenance.htm"
}
Send request to the apologies pool
LB::reselect pool pool_apologies_http
log local0. "[IP::client_addr]:[TCP::client_port]: Reselecting member from the apologies pool"
}
Aaron