Forum Discussion
Jim_Jack_103645
Nimbostratus
Aug 27, 2007redirect based on uri
We have a pool of servers which we direct our traffic to. Our testers want to be able to choose which server their request goes to by using a querystring.
e.g. we have servers a, b, c, d and e i...
hoolio
Cirrostratus
Aug 30, 2007That looks like a good start. I think your switch statement is slightly off though. Are you ever seeing traffic go to any but the default pool?
I think {v1} would be evalutated as a literal string of v1, not the variable value for $v1. Regardless, you can avoid using the variable altogether.
switch [URI::query [HTTP::uri] "lbsc"] {
"" {
pool MIS-WEB50-DM
}
"c" {
pool MIS-WEB50C
}
"d" {
pool MIS-WEB50D
}
"e" {
pool MIS-WEB50E
}
"f" {
pool MIS-WEB50F
}
default {
pool MIS-WEB50-DM
}
}If most of your requests won't have the lbsc parameter set, you could have the first test in the switch be "".
Aaron
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