Forum Discussion
Jim_Jack_103645
Nimbostratus
Aug 27, 2007redirect based on uri
We have a pool of servers which we direct our traffic to. Our testers want to be able to choose which server their request goes to by using a querystring.
e.g. we have servers a, b, c, d and e in the pool.
If they use querystring 'lbsc=d' in the uri then we direct traffic to server 'd'
Does anyone have any ideas?
- Jim_Jack_103645
Nimbostratus
Here is my first attempt. - hoolio
Cirrostratus
That looks like a good start. I think your switch statement is slightly off though. Are you ever seeing traffic go to any but the default pool?switch [URI::query [HTTP::uri] "lbsc"] { "" { pool MIS-WEB50-DM } "c" { pool MIS-WEB50C } "d" { pool MIS-WEB50D } "e" { pool MIS-WEB50E } "f" { pool MIS-WEB50F } default { pool MIS-WEB50-DM } }
- Jim_Jack_103645
Nimbostratus
Thanks :-) - Jim_Jack_103645
Nimbostratus
This works, but only for the first request. Subsequent requests are directed to other servers in the pool, I asume by persistence. Is there any way to switch it off and persist to the requested node?? - Jim_Jack_103645
Nimbostratus
I tried to add cookie persistence to the irule to no effect: - Deb_Allen_18Historic F5 AccountApply a OneConnect profile to the virtual, and you should see that each request on the same connection is evaluated & routed to the desired pool. (Without OneConnect, the first pool chosen is used for the life of the connection.)
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