Forum Discussion
lisiecki_54902
Nimbostratus
Jun 09, 2009https redirect to pool based on uri
I have looked though many examples. I recieve an https request and I need to forward to a pool based on uri:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/thing1" } {
...
hoolio
Cirrostratus
Jun 15, 2009You can save resources by not checking further options once one match is done. You can do this by using if/elseif/else logic or a switch statement:
when HTTP_REQUEST {
Check requested path with wildcard support
switch -glob [HTTP::path] {
"/thing1*" {
Rewrite host header value and select pool
HTTP::header replace Host a.b.c:1082
pool thing1pool
}
"/thing2*" {
Rewrite host header value and select pool
HTTP::header replace Host a.b.c:1080
pool thing2pool
}
"/" {
Redirect client
HTTP::redirect "https://a.b.c/thing1"
}
default {
Rewrite host header value and select pool
HTTP::header replace Host a.b.c:1080
pool thing2pool
}
}
}
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