Forum Discussion
pablitop_134672
Nimbostratus
Sep 26, 2015Irule to redirect traffic based on path and uri
I have to redirect some traffic based on path and other based on uri. The irule should look something like this, but it´s not working. I should get working something like I post below. Any help?
...
Sep 26, 2015
Your question is a bit vague, but this might push you in the right direction.
when HTTP_REQUEST {
Set a variable to control if a pool has been chosen or not.
set chosen 0
switch [string tolower [HTTP::uri]] {
"/bla/blabla.gif" { set chosen 1; pool pool-frontend }
}
Check if the switch has chosen a pool
if { $chosen != 1 } {
if { [HTTP::path] starts_with "/bla" } {
pool pool-frontend2
} else {
pool default_pool
}
}
}
Please note that I have not tested the rule myself.
/Patrik
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