Forum Discussion
dr_tamfr_dhp_19
Nimbostratus
Sep 01, 2015iRule for setting pool based on URI path
Hello,
I know it's possible to set a pool based on the URI path. But what I need to do past that is a bit more complex, and I'm not sure where to begin.
I have two pools I'm testing with: ...
Brad_Parker
Cirrus
Sep 01, 2015Try this, it will check to see if you have a pool created that matches the http hostname_pool and if not go to your default pool. If it does it will go to the corresponding pool.
when HTTP_REQUEST {
if { [getfield [HTTP::host] "." 1] ends_with "tr"}{
if { [catch {pool [string tolower "[HTTP::host]_pool"]}] }{
pool "default_pool"
}
else {
pool [string tolower "[HTTP::host]_pool"]
}
}
}
Updated.
- Brad_ParkerSep 01, 2015
Cirrus
probably throw a string to lower in there in case someone requests with caps, when HTTP_REQUEST { if { [catch {pool [string tolower "[HTTP::host]_pool"]}] }{ pool "default_pool" } else { pool [string tolower "[HTTP::host]_pool"] } } - Brad_ParkerSep 01, 2015
Cirrus
This will not satisfy the problem posed.
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