Forum Discussion
Stanislas_Piro2
Mar 13, 2018Cumulonimbus
You can change your irules like that
Pool_Selection_iRule:
when HTTP_REQUEST {
HTTP::host [string tolower [HTTP::host]]
catch { pool "[HTTP::host]_pool"}
}
Sorry_Page_iRule:
when HTTP_REQUEST priority 900 {
set dpool [LB::server pool]
if { $dpool equals "" } { HTTP::redirect "http://sorry_page.com" ; unset dpool; return}
if { [active_members $dpool] == 0 } { HTTP::redirect "http://sorry_page.com"; unset dpool; return}
unset dpool
}
when LB_FAILED {
log -noname "[virtual name] DEBUG: Server Pool: $PoolName SELECTED"
if { [active_members [LB::server pool]] == 0 } {
log -noname "Sorry Page Activated / Server Pool: $PoolName selection failed on connection attempt from [IP::client_addr]"
HTTP::redirect "http://sorry_page.com"
}