Forum Discussion
Jace_45978
Nimbostratus
Jun 19, 2009CSS to F5 iRule redirect to pool question.
have a CSS that we are moving away from and going to F5 v9.4.7
The CSS has two VIPs same IP and port one is a default url "*" goes to server A and the other is url "/battery/*" goes to service B
I am thinking that I create a standard port 80 VIP with default pool A and attach irule that sends /battery/ request to pool B
when HTTP_REQUEST {
if {[HTTP::uri] contains {/battery/}}
{pool B}
}
}
is there a better way to right this or will this even work?
Thanks in advance.
here is sample from CSS:
content blah-80
vip address 1.1.1.1
add service serverA
protocol tcp
port 80
url "/*"
active
content blah-battery-80
vip address 1.1.1.1
add service serverB
protocol tcp
port 80
url "/battery/*"
active
- James_Quinby_46Historic F5 AccountThat should work fine, with a slight adjustment for correct syntax and a bit of string normalization:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "battery"} { pool apache_pool } }
- Jace_45978
Nimbostratus
will give this a try. The string tolower.. is tolower just part of string rule? not familiar with that term. - James_Quinby_46Historic F5 Account'string' is a TCL command, and there are bunch of interesting things you can do with it. There's a great rundown of some of them here:
- hoolio
Cirrostratus
"/battery/*" would match a path starting with /battery/, so you could use [HTTP::path] starts_with "/battery/" for the same functionality. If the web app is not case sensitive, you could set the path to lowercase before checking that it starts with /battery/ as jquinby suggested. - Jace_45978
Nimbostratus
Thanks for all the info..
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