Forum Discussion
Robert_Pagano_7
Nimbostratus
Nov 14, 2007pool selection based on path in URI (and subsequent URI path modification)
I am trying to route connections based on the portion of the URI after the hostname.
For example, connections to...
http://www.example.com/lms/path/to/resource
...
hoolio
Cirrostratus
Nov 14, 2007Hi,
You can use string map to remove the prefix "/lms" and HTTP::uri to update the URI. Here's an example:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/lms" } {
pool LMS_pool
HTTP::uri [string map {/lms {}} [HTTP::uri]]
log the original and updated URI's using the cached copy from HTTP::uri
log local0. "URI - original: [HTTP::uri], updated: [string map {/lms {}} [HTTP::uri]]"
} elseif { [HTTP::uri] starts_with "/content" } {
pool content_pool
}
}
Aaron
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