Forum Discussion
jackmoscow_2940
Nimbostratus
Dec 29, 2016multiple conditions for redirect other pools
Good day, all!
Can you please tell how to make traffic redirection for multiple conditions and in different pools of sending traffic to these inspections, if there is no match to do a redirect traffic to the default pool of options for me were written in non-working.
when HTTP_REQUEST {
if {[class match [string tolower [HTTP :: path]] starts_with "ABC"]} {
pool SF_ABC
} Else {
if {[class match [string tolower [HTTP :: path]] contains "/auto/hit"]} {
pool SF_AUTO
} Else {
pool default
}
}
1 Reply
- CharlesCS
Cirrus
Note that a "string tolower" comparison on the HTTP path will never match an upper-case string. A path always starts with a forward-slash. Also, watch out for embedded blanks.
when HTTP_REQUEST { if {[class match [string tolower [HTTP::path]] starts_with "/abc"]} { pool SF_ABC } elseif {[class match [string tolower [HTTP::path]] contains "/auto/hit"]} { pool SF_AUTO } else { pool default } }
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
