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...
Kevin_Stewart
Employee
Apr 23, 20131. The host is always the same.
I would then recommend not evaluating the [HTTP::host] value. It provides no value.
2. URI and port are specific. e.g. example.mtd.today.com:8088/tuesday does not change. Can it evaluate either port or both just in case I decide to redirect to another port or uri?
You'd need to modify the iRule switch conditions in either case. So if port 8088 always equals the "/tueday" URI, which equals the Stagin_Pool pool, then I'd recommend just evaluating the port OR the URI.
3. Do I need to use the quoten " " on switch before and after the parentesis ?
A switch conditional is generally a string comparison. I added the quotes in my last example because I needed to insert the colon ":" character in the evaluation string. If you're just evaluating the port or URI, the the following (without quotes in the switch) will work:
switch [TCP::local_port] {
...
}
or
switch [string tolower [HTTP::uri]] {
...
}
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