Forum Discussion
Alan_Evans_1020
Nimbostratus
Apr 08, 2009iRule (HTTP) to select pool based on URI then continue using that pool for duration of session
I am working on a HTTP iRule where I want to create an iRule that selects a pool based on an entry URI and then have the HTTP session continue using that pool and redirect the user to a regular URI fo...
Alan_Evans_1020
Nimbostratus
Apr 09, 2009A few tweaks still to be done but this is the basis of what I am using.
when HTTP_REQUEST {
set lb_persist [LB::persist]
set lb_server [LB::server addr]
set lb_key [LB::persist key]
set http_uri [HTTP::uri]
log local0. "persist: [LB::persist] server: $lb_server uri: $http_uri"
if { [LB::server addr] eq "" }{
if { [HTTP::path] starts_with "/dev" } {
pool pool_dev
eval [LB::select]
persist cookie
HTTP::redirect https://[HTTP::host]/?[HTTP::query]
} elseif { [HTTP::path] starts_with "/train" } {
pool pool_train
eval [LB::select]
persist cookie
HTTP::redirect https://[HTTP::host]/?[HTTP::query]
} elseif { [HTTP::path] starts_with "/prod" } {
pool pool_prod
eval [LB::select]
persist cookie
HTTP::redirect https://[HTTP::host]/?[HTTP::query]
}
}
}
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
