Forum Discussion
tkrn_92652
Nimbostratus
Aug 26, 2011Redirect to Pool based upon URL
The following is our problem. We have multiple customers on the same middleware. Each middleware operates on a separate instance/port so each customer has their own port for various reasons. How can I create a lookup table to a data based of the content based after the / in the URL
Below gives you more a visual of what I am trying to do. ANY direction would be great. The F5's are brand new to us and trying to figure them out since no one here has experience with them.
Thanks!
http://virtual_ip/customer_a (F5)
host1:8080 (JBOSS HTTP)
host2:8080 (JBOSS HTTP)
http://virtual_ip/customer_b (F5)
host1:8081 (JBOSS HTTP)
host2:8081 (JBOSS HTTP)
http://virtual_ip/customer_c (F5)
host1:8082 (JBOSS HTTP)
host2:8082 (JBOSS HTTP)
1 Reply
- Michael_Yates
Nimbostratus
Hi tkrn4,
You can create separate pools for each set of servers (I am grouping them together so that the iRule makes more sense):
pool.for.set.1.on.port.8080
host1:8080 (JBOSS HTTP)
host2:8080 (JBOSS HTTP)
pool.for.set.1.on.port.8081
host1:8081 (JBOSS HTTP)
host2:8081 (JBOSS HTTP)
pool.for.set.1.on.port.8082
host1:8082 (JBOSS HTTP)
host2:8082 (JBOSS HTTP)
Then try this:when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/customer_a*" { pool pool.for.set.1.on.port.8080 } "/customer_b*" { pool pool.for.set.1.on.port.8081 } "/customer_c*" { pool pool.for.set.1.on.port.8082 } } }
Note the Wildcard "*" is placed at the end because entries in a switch statement are literal.
Hope this helps.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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