Forum Discussion
Brad_Baker
Cirrus
Oct 01, 2013Directing traffic based on query parameter
We need the ability to direct traffic to a specific node on our LTM load balancers based on query parameter.
So for instance if I enter www.foo.com/some-article?s=web-server1 the request would ...
Kevin_Stewart
Employee
Oct 01, 2013As Steve relates, you need some (unfortunately manual) approach to mapping the web server's name to a node address. This can usually be done with a string-based data group. Example:
Data group (ex. my_webserver_dg):
"web-server1" := "10.10.10.10 80"
"web-server2" := "10.10.10.11 80"
"web-server3" := "10.10.10.12 80"
"web-server4" := "10.10.10.13 80"
"web-server5" := "10.10.10.14 80"
And then an iRule that looks for the query string and routes accordingly, otherwise uses standard persistence:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/myarticle.php?s=" } {
set webserver [URI::query [string tolower [HTTP::uri]] s]
if { [class match $webserver equals my_webserver_dg] } {
set nodelist [split [class -value match $webserver equals my_webserver_dg] " "]
node [lindex $nodelist 0] [lindex $nodelist 1]
}
}
}
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
