Forum Discussion
Chris_Stamm_183
Nov 03, 2010Nimbostratus
http class profile and trailing /
I have one VIP. DNS would resolve this VIP as such. 10.1.1.1 = www.abc.com
VIP: 10.1.1.1:80
To keep it simple let's say I have three http class profiles configured below.
Httpclass1
Look for host name regex string (?i)www.abc.com
Look for URI regex string (?i)uri1
If both are matched then send to Pool1
Httpclass2 Look for host name regex string (?i)www.abc.com
Look for URI regex string (?i)uri2
If both are matched then send to Pool2
Httpclass3
Look for host name regex string (?i)www.abc.com
If matched then send to Pool3
The idea is that if a person types www.abc.com/uri1 (or other variations www.abc.com/uri1/ www.abc.com/uri1/test.html etc.) they are sent to Pool1. If they send www.abc.com/uri2 they are sent to Pool2. The last http class (httpclass3) is a catch all for the domain www.abc.com. I am matching host because eventually there will be more than one host so I would want to be able to match host and URI then make the decision.
So - the problem is that the user has to type a trailing slash www.abc.com/uri1/ or www.abc.com/uri2/ otherwise it will not catch the string. If the user just types www.abc.com/uri1 or www.abc.com/uri2 then it misses the catch with httpclass1 and httpclass2 so it sends to the catch all http class (httpclass3) and the desired effect is lost.
Am I doing something wrong in my URI match in the http class?
I have tried all of the following...
/uri1 (pattern string)
/uri1* (pattern string)
uri1 (pattern string)
uri1* (pattern string)
(?1)/uri1 (regex)
(?1)/uri1* (regex)
(?1)uri1* (regex)
and none seem to work it always requires the trailing /
- L4L7_53191NimbostratusChris: for this particular task I'd actually suggest going the iRule route. Do a search on uri switching and you'll see a bunch of examples. I'd suggest using the switch -glob command for this as well. Have a look here for the general idea (look at the second example on URI switching):
- Chris_Stamm_183NimbostratusIs it more efficient?
- hooleylistCirrostratusHi Chris,
- Chris_Stamm_183NimbostratusWith that part working I have another related issue that surfaced. Because we redirect to a different pool on the backend based on the URI that particular URI is sent back unaltered to the backend server - for example...
- hooleylistCirrostratusYou can use standard TCL commands in the rewrite field:
- Chris_Stamm_183NimbostratusWorked famously.
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