Forum Discussion
John_Lin_106399
Nimbostratus
Jan 04, 2007URI rewrite to pool?
I'm looking at our current iRules which so a URI check and sends it to proper pools preserving the URI but now we need to send it to a particular pool with different URI.
My iRule looks likes below
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/a/" } {
pool PoolA }
elseif { [HTTP::uri] starts_with "/b/" }
{ pool PoolB}
}
But if I want traffic that starts with /b/ to goto PoolB but instead of passing "/b/*" as request pass say "/c/*"
What is the proper way to do this while still preserving what goes after the /b/ ?
Please advise
- Deb_Allen_18Historic F5 AccountThanks for the info, bl0ndie. Nice adds.
- bl0ndie_127134Historic F5 AccountLooks like they were added on 9.2.
- bl0ndie_127134Historic F5 AccountOh I forgot to mention that we also added a query parser that returns the parameter value.
URI::query
- hoolio
Cirrostratus
Hi Blondie,[HTTP::uri] - /path/to/a/file.ext;session_id=abcdefgh?param=value [URI::path [HTTP::uri]] - /path/to/a/ [URI::path [HTTP::uri] 2 10] - /to/a/ [URI::path [HTTP::uri] 1] - /path/to/a/ [URI::path [HTTP::uri] depth] - 3 [HTTP::path] - /path/to/a/file.ext;session_id=abcdefgh [HTTP::query] - param=value [URI::query "param"] -
- bl0ndie_127134Historic F5 AccountTry ...
URI::query
- bl0ndie_127134Historic F5 AccountThis can be really useful when you have multiple parameters like this ....
[HTTP::uri] - /path/to/a/file.ext?para1=val1¶2=value2¶3=value3¶4=value4 [URI::query [HTTP::uri] "para3"] - value3
- I just added a sample to code share that illustrates interrogating the URI with all the above mentioned methods.
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