Forum Discussion
Chris_Phillips
Nimbostratus
Feb 04, 2011assignment to pool and uie persist to member
Hi,
I've a slightly odd scenario I'm trying to work out as slickly as possible with LTM's (before we've received them, so dev is hard...). We have a web app (apache fronting tomcat) of which...
L4L7_53191
Nimbostratus
Feb 07, 2011Here's a quick example that lines up with the original URI based method...
when HTTP_REQUEST {
The first part of the URI should be a pool.
for this example, my pools are named "p_1" and "p_2",
so the URI of '/p_1/foo/bar.html will point to pool p_1,
then the cookie persistence will take care of subsequent requests.
NO default pool is set on the Virtual Server, and
use a cookie insert persistence profile on the VS.
Using variables for clarity.
set uri [HTTP::uri]
if { $uri ne "" } {
Set the pool name, strip off slashes.
set p [string map {"/" ""} [URI::path $uri 1 1]]
}
if {$p starts_with "p_"} {
log local0. "orig URI: $uri"
set newuri [string map "/$p/ /" $uri]
log local0. "New uri is: $newuri"
Set the new URI.
HTTP::uri $newuri
persist cookie
pool $p
log local0. "Selecting pool: $p, uri is [HTTP::uri]"
} else {
log local0. "Nothing to do, no pool in URI."
}
}
HTH,
-Matt
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