If you send a redirect to the client, the address bar will update with the new location. If you define the web-static.mysite.com server in a pool, you could check if the main
www.mysite.com pool is down in CLIENT_ACCEPTED and select the web-static pool instead:
when CLIENT_ACCEPTED {
Check if the VIP's default pool has no members up
if {[active_members [LB::server pool]] == 0}{
Select alternate pool
pool www-static.mysite.com_pool
}
}
This will only check the pool state of the VIP's default pool when each client connects to the VIP. If you want to check on each HTTP -request you could move the pool checking to HTTP_REQUEST:
when CLIENT_ACCEPTED {
Save the name of the VIP's default pool
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
Check if the VIP's default pool has no members up
if {[active_members $default_pool] == 0}{
Select alternate pool
pool www-static.mysite.com_pool
}
}
If you wanted to trigger this same logic when an individual load balancing attempt fails, you could add logic to the LB_FAILED event which checks 'if {[active_members $default_pool] == 0' and then calls LB::reselect to select www-static.mysite.com_pool. See the LB::reselect wiki page for details:
LB::reselect
http://devcentral.f5.com/wiki/default.aspx/iRules/lb__reselect
Aaron