Forum Discussion
Tadaoki_237078
Nimbostratus
Dec 17, 2015iRules: Pool selection by URI and cookies
Hello everyone
I want to make an iRule which;
1) Select a pool by URI during first http request
2) For the subsequent requests for css and graphic files(with URI different than the first
req...
Kai_Wilke
MVP
Dec 17, 2015Hi Kai,
instead of using
[substr [ HTTP::uri ] 1] (aka. striping the first character) in combination with "foo/" you may want to use just [HTTP::uri] in combination with "/foo/". Both will work, but the later one will save you some CPU cycles.
instead of using
[string map {"/bar/" "/"} [HTTP::uri]] you may want to use [string range [HTTP::uri] 4 end], where "4" represents the number of trailing chars to be removed. Again... both will work, but the later one will save some additional CPU cycles.
The cookie based routing problem you're experincing, is almost impossible to fix using multiple independend cookie_names. I would recommend to change your cookie based routing logic to use an additional "cookie_name" for both subsites. The value of this cookie would then contain the needed routing (e.g. either "foo" or "bar"). The cookie could be insert by your backend servers or using an
HTTP_RESPONSE iRule at the time the user visits the URI /foo or /bar. To move between the different subsites, you have to make sure the user visits the URI /foo or /bar initially, to get the new cookie value.
Cheers, Kai
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