Forum Discussion
Christofer_Tib1
Nimbostratus
Apr 26, 2006iRule with several pools bring down whole VS
Hi.
I have a VS with a iRule on it that sends the traffic based on the host header to different pools.
The problem I'm having now is that if one of these pools goes down then all Wide-IPs (6...
Chris_Wentland2
Nimbostratus
Apr 30, 2006Hey,
I noticed that you are re-writing your URI on every request to force the client into a particular directory structure. Here is a snippet of cleaned up code that may be more efficient for you than rewriting every request.
Basically, you look for the URL and matching application dir in the URI. If it matches, it goes to the pool. Otherwise, you get redirected to the original URL/Application DIR. This way, you are not rewriting every request, and clients cannot look outside of your web directory.
when HTTP_REQUEST {
if { [HTTP::host] equals "www1.test.com" and [HTTP::uri] starts_with "/www1/"} {
pool www1
} elseif { [HTTP::host] equals "www2.test.com" and [HTTP::uri] starts_with "/www2/"} {
pool www2
} elseif { [HTTP::host] equals "www1.test.com"} {
HTTP::redirect "http://[HTTP::host]/www1/"
} elseif { [HTTP::host] equals "www2.test.com"} {
HTTP::redirect "http://[HTTP::host]/www2/"
} else {
drop
}
}
Thanks and good luck!
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