Forum Discussion
Mr_K_63985
Nimbostratus
Feb 18, 2010Fallback Host - Keep VIP URL
What I am hoping to achieve is to have fallback host continue to use the VIP URL.
For example:
www.mysite.com
pool:web1.mysite.com, web2.mysite.com
fallback host:we...
hoolio
Cirrostratus
Feb 19, 2010If 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
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