Forum Discussion
NetCohort_66543
Nimbostratus
Jun 27, 2013Website Redirection and pool allocation
Hi all,
i have a VS which acts as an fullproxy. I wrote an iRule which redirects a request and chosse the right member. The identifier for the member allocation comes with the url.
...
Kevin_Stewart
Employee
Jun 27, 2013There a few problems with the above iRule:
1. if { "[HTTP::host][HTTP::uri]" contains "/target1" } { - You are evaluating the URI so you really only need [HTTP::uri]:
if { [string tolower [HTTP::uri]] starts_with "/target1" }
2. You have a redirect and pool statement in the same stanza. A redirect issues a 302 response to the client, telling it to go somewhere else, so the pool statement is never evaluated.
3. In your redirect you're essentially sending the user back to "/", so when they return you've lost all context to where they should be going (based on where they came from). If you're redirecting all users to the same host ("domain.de") and URI ("/"), how will the F5 know what the request is intended for? The URI-based redirection you're using would work if the applications lived under these static URIs, but they don't.
Ultimately you need a client side way of distinguishing a request. Clients can generally handle URIs, cookies, hosts, and other things (as long as they're consistent). Here are few options:
a. Host name - by far probably the easist, if you can separate the applications into different hostnames, even if using the same VIP, that would make things much simpler.
b. If users don't flip back and forth between /target1 and /target2, you could set a cookie in the initial response and traffic persistence that way.
c. ProxyPass and VIP-targeting. It's a stretch, but it could potentially work.
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