Forum Discussion
Neil_66348
Nimbostratus
Jan 24, 2010HTTP URI to multiple pools
Hi guys ,
Fairly new to iRules and TCL , would like to have the ability to have different uri's for the same site directed to different pools.
Essentially :
www.co...
Moe_Jartin
Cirrus
Jan 25, 2010Neil,
It doesn't apper that there are multiple host names involved so you only need to match on the HTTP::uri.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
No path goes to pool-1
/ {
pool pool-1
}
paths that start with /account go to pool-2
/account* {
pool pool-2
}
paths that start with /service go to pool-3
/service* {
pool pool-3
}
all other requests go to pool-4
default {
pool pool-4
}
}
}
Also, it is hard to tell from your example but, it looks like you are also trying to define the "default context" or "default document" for a given path. i.e. If request comes in for /account then rewrite or redirect to /account/path/index.html.
When I get requests like this from the server guys I usually tell them that is the server's job (:-D) to define the default context/document but, it can be done on the LTM. First I would sugest a redirect and NOT a rewrite. Also, you just have to be careful to to use an effective "equals" and not a "starts_with" or you will end up with an infinite redirect. Let us know if that is what you are trying to do and we can help with the irule.
Joe
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