Do you have a default pool? Otherwise the F5 don't know where to send the request which would result in an error. Also, the if statement above is always true.
Simple example:
(not 1) or (not 2)
- If it's 1 it means that it's not 2 = true
- If it's 2 it means that it's not 1 = true
Sure you don't want an "and" between the different cases? If that's the case you might want to rewrite it a bit. Try this one:
when HTTP_REQUEST {
Convert to lower case
set uri [string tolower [HTTP::uri]]
if { $uri starts_with "/something" or $uri starts_with "/something1" or $uri starts_with "/something2" or $uri starts_with "/something3" }{
pool mypool
} else {
HTTP::redirect "https://www.abc.com"
}
}
Depending on if the number of cases would grow or not I might consider putting the uri's in a data group list instead:
- Create a data group list of type string and populate it with all the uri's you want to match
- Create an irule, replace myurilist with whatever name you gave the data group list.
irule definition:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] starts_with myurilist] }{
pool mypool
} else {
HTTP::redirect "https://www.abc.com"
}
}
What the rule does is to convert the current uri to lower case and the check if it starts with any of the entries in the data group list.
Disclaimer:
It's not been tested or validated for syntax. 🙂
/Patrik