Forum Discussion
CBerg64_161993
Nimbostratus
May 19, 2015iRule to select Pool
I have 2 pools that need to be access by the same url but with different jsp files. Ie. test.com/test1.jsp goes to pool 1 and test.com/test2.jsp goes to pool 2. But no other content for the site h...
Alexander_Dube_
Altocumulus
May 20, 2015Hi,
i've just written the following. You can try this, but without any guaranty 😉
when HTTP_REQUEST {
if { [HTTP::cookie exists Pool]} {
switch [HTTP::cookie Pool] {
"pool1" {
pool Test1-pool
}
"pool2" {
pool Test2-pool
}
}
} else {
if { [HTTP::uri] contains "test1.jsp" } {
pool Test1-pool
} elseif { [HTTP::uri] contains "test2.jsp"} {
pool Test2-pool
}
}
}
when HTTP_RESPONSE {
if { [HTTP::uri] contains "test1.jsp" } {
HTTP::cookie insert name Pool value "pool1"
} elseif { [HTTP::uri] contains "test2.jsp"} {
HTTP::cookie insert name Pool value "pool2"
}
}
Regards Alex
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