Forum Discussion
Elias_O_16228
Nimbostratus
Apr 22, 2013Redirecting request based on port number
I have two application servers as pool members to multiple pools. I want to be able to load balance based on port.
For example, If a user click first link, load balance staging pool. If user is...
Colin_Walker_12
Apr 26, 2013Historic F5 Account
It sounds like what you're looking for is something like:
when HTTP_REQUEST {
switch -glob [TCP::local_port][string tolower [HTTP::uri]] {
"8088/tuesday*" { pool Stagin_Pool }
"8089/wednesday*" { pool Management_Pool }
"8090/thursday*" { pool Development_Pool }
"8091/friday*" { pool Test_Lab_Pool }
default { pool Production_Pool }
}
}
This would allow you to evaluate on the port and URI, regardless of the hostname. Is that what you're looking for?
As Kevin said, above, if you want to specifically match case and send individually cased URIs to different locations, then simply remove the string tolower command that's affecting the HTTP::uri, and then add multiple cases for those, such as:
...
"8088/tuesday*" { pool Stagin_Pool }
"8088/TUESDAY*" { pool ALLCAPS_Pool }
...
Colin
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