Forum Discussion
Nick_T_68319
Nimbostratus
Apr 01, 2014Select 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 th...
IheartF5_45022
Nacreous
Apr 03, 2014I 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
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