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...
Michael_Yates
Nimbostratus
Aug 26, 2011Hi 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.
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