Forum Discussion
Iain_McGuire_11
Nimbostratus
Aug 02, 2006Redirecting hosted sites on availablily (not servers)
Can someone clarify if the following is possible? My feeling is it's not, using only LTMs, although I'd be happy to hear otherwise.
Our customer currently has two IIS servers, which between them host about 20 virtual websites, each with their own domain name. We currently load balance based on the availability of the webserver, based on it's IP. They would like to be able to stop a site on one server, and have traffic just for that site be redirected to the second server.
They're thinking they could put a text file in the root directory of each site, and check for the availability of the site by doing a GET for that file. I believe I can write an iRule to do that, but if it's not available (because the SITE, not the SERVER, is offline), it will mark the member as down, won't it? At which point no traffic will be sent to that IP address, until it successfully GETs the file.
Is there a way of achieving this? Being able to mark a site on a shared IP as down, but other sites on the same IP as up?
- dennypayne
Employee
If the sites are configured with different pools/virtuals, then normal health monitors should take care of this without a need for iRules. If everything is going through the same pool/vip, then you could possibly look at the HTTP_RESPONSE for an error (404,500,etc) and use LB::reselect if you see it (there has been some discussion of this on the forum, just search for LB::reselect to find those threads). -EDIT Actually LB::reselect is not valid within HTTP_RESPONSE, I'll post again with something that may work... - hoolio
Cirrostratus
Hello, - hoolio
Cirrostratus
Hey Denny, - Iain_McGuire_11
Nimbostratus
Guys, - Iain_McGuire_11
Nimbostratus
Sorry, I think I misread / misunderstood the previous comments in this thread prior to my last post. I'll lab this to check I get what you're saying. Thanks. - dennypayne
Employee
Yes, separating the ports would make it easier to differentiate, but what we are saying is that even if they run on the same port, as long as they are in different pools with different monitors, one going down won't affect the other. You would still need to use an iRule as you said to select a pool based on the domain name. - Iain_McGuire_11
Nimbostratus
Denny, - Iain_McGuire_11
Nimbostratus
Actually, i've ran aground a bit with creating the monitor for the pool. I can write an iRule to choose a pool based on the domain name, but what syntax can I use to specify a host header to send in the monitor? So that I can determine if a particular site (member of a pool) is up or down? - hoolio
Cirrostratus
You can configure a monitor to send an HTTP/1.1 formatted request, including the host header using the following configuration:monitor http_1.1_pool1_monitor { defaults from http send "GET /status.html HTTP/1.1\nHost: mysite.com\nConnection: close\n" recv "200 OK" }
- Iain_McGuire_11
Nimbostratus
Thanks again. That's a lot easier than I was expecting, and I have to say I'm very impressed by the speed of replies on this forum.
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