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:web-static.mysite.com
If web1/2 is down, www.mysite.com gets redirected to web-static.mysite.com. However I would like to keep the URL as www.mysite.com instead of web-static. Is this doable via iRule?
- hoolio
Cirrostratus
Sure...when HTTP_REQUEST { Save the URI set uri [HTTP::uri] } when LB_FAILED { HTTP::fallback "http://web-static.mysite.com$uri" }
- Mr_K_63985
Nimbostratus
I tried your iRule, however when I take down the web server, it still shows fallback host's URL, instead of VIP URL. - hoolio
Cirrostratus
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 } }
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 } }
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