Forum Discussion
jethro_106302
Nimbostratus
Dec 16, 2008uri based pool selection and persistence
Hi Folks,
I am rather new to using iRules, and would like some advice for a problem I'm trying to solve.
I want to have an http virtual server, sharing the load on two pools...
hoolio
Cirrostratus
Dec 16, 2008Hi Jerome,
You could probably move the two cookie checks into the respective tests on the URI. If the cookies are set with a path, they should only be sent by the client in a request which starts with that path.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/foo" } {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist uie [HTTP::cookie "JSessionID"]
}
pool pool_A
} elseif { [HTTP::uri] starts_with "/bar" } {
if { [HTTP::cookie exists "FOOBAZOO"] } {
persist uie [HTTP::cookie "FOOBAZOO"]
}
pool pool_B
} elseif { [HTTP::uri] equals "/" } {
HTTP::redirect /foo
} else {
pool pool_A
}
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist add uie [HTTP::cookie "JSESSIONID"]
}
if { [HTTP::cookie exists "FOOBAZOO"] } {
persist uie [HTTP::cookie "FOOBAZOO"]
}
}
Aaron
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