Forum Discussion
Pconlan_71037
Dec 06, 2012Altocumulus
Looks to me like you are missing a closing curly brace after each of the first two switch statements, and an extra one after the last switch statement. Does this work?
when HTTP_REQUEST {
Redirect to www.site.org
switch -glob [string tolower [HTTP::host]] {
"site.org" -
"site.com" -
"www.site.com"
{
HTTP::respond 301 Location "http://www.site.org[HTTP::uri]"
}
}
Match uri patterns and redirect to https
switch -glob [string tolower [HTTP::uri]] {
"/uri1*" -
"/uri2*" -
"/uri3*" -
"/uri4*" -
"/uri5*"
{
log local0.alert "https redirect:[HTTP::host]-[HTTP::uri]-[HTTP::path]"
HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]"
return
}
}
Match uri's and send traffic to pool
log local0.alert "BEGIN Host:[HTTP::host]-[HTTP::uri]-[HTTP::path]"
switch -glob [string tolower [HTTP::uri]] {
"/" -
"/*" -
"/\\?*" -
"/uri10/*" -
"/uri11/*" -
"/uri12/*" -
"/uri13/*" -
"/uri14/*" -
"/uri15*"
{
log local0.alert "pool1 Host:[HTTP::host]-[HTTP::uri]"
pool pool1
return
}
default {
pool pool2
}
}
}