Forum Discussion
hooleylist
Aug 08, 2006Cirrostratus
That looks like a good start as far as logic goes. I would suggest using contains, starts_with or equals instead of matches_regex, unless you really need to use a regular expression to match the hostname as matches_regex is more resource intensive that the string comparisons.
The redirect syntax you are using is from 9.x though, not 4.x. To redirect a request in 4.x, try this format:
if ((http_host equals "www.site.com") and (http_uri starts_with "/secure1")) {
redirect to "https://www.site.com" + http_uri
}
If you want to specify the pool when the client is redirected to HTTPS, you would want to create another rule on the loopback VIP the SSL proxy points to that sets a pool based on the URI. Here is an example for that rule:
if (http_uri starts_with "/secure1") {
use pool pool1
}
else {
use pool default_pool
}
Aaron