Forum Discussion
afara2000_1973
Nimbostratus
Feb 13, 2010redirect to two pools with diff ports
I'm pretty new to irule. I'm trying to access two different web instances using URIs. Requirement is to use single VIP. e.g.,
http://www.mycompany.com/ ;goes to pool1:port1
http://www.mycompany.com/app2 ;goes to pool2:port2 with no app2 in url
Both web instances are on same server(s) listening on two different TCP ports and have their own index.html. I have created pool1 and pool2 with following irule:
when HTTP_REQUEST {
if [string tolower [HTTP::path]] eq "/app2"}{
pool Pool_2
}else {
pool Pool_1
}
}
The problem is that I can only get to pool2 by using a file called "app2" in the 2nd web instance folder and "app2" word is visible. I have also tried: HTTP::redirect "http://[HTTP::host]/" after pool pool_2 but that goes to pool1.
How do I get F5 to send it to /index.html for second web instance for http://www.mycompany.com/app2 request and remove "app2" from the URL?
Any help is appreciated very much. Thanks.
- The_Bhattman
Nimbostratus
Hi AFara2000,when HTTP_REQUEST { switch [string tolower [HTTP::uri]] { "/app2" { HTTP::uri /[HTTP::uri] pool Pool_2 } default { pool Pool_1 } } }
- afara2000_1973
Nimbostratus
Thanks Bhattman for your code but that didn't take care of /app2 in uri. I decided to use /app2/* for all web application 2 paths. Therefore, I modified your code and this seems to be working fine:
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