Forum Discussion
Select pool based on URI and maintain with cookie
I don't know if this is possible, but I want to select a different pool based off something in the URI. like ?site=testsite perhaps. But the problem is, I want to persist it to that pool even if that string is no longer in the URI. So the first page land will have it in the URI, but the rest of the journey wont.
when HTTP_REQUEST { if { [HTTP::uri] contains "testsite" } { { pool testsite-pool } }
2 Replies
Hi mate!
Check out this article?
Maybe something like this?
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "testsite" } { persist cookie insert testsite_persist 0 pool testsite-pool } }/Patrik
- IheartF5_45022
Nacreous
I think you can just use normal cookie persistence profile on the virtual without using an iRule for it, however you will need to use another cookie to say "use test pool". Try this;-
when HTTP_REQUEST { set fAddCk 0 if {[HTTP::cookie exists "X-testpool"]} { pool pl_test_http } elseif { [string tolower [HTTP::uri]] contains "testsite" } { pool pl_test_http Set flag to insert cookie if it doesn't already exist set fAddCk 1 } } when HTTP_RESPONSE { if {$fAddCk} { HTTP::cookie insert name "X-testpool" value "blah" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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