Forum Discussion
hooleylist
Sep 12, 2011Cirrostratus
Here's an updated version which uses a switch statement to check the URI and corrects the datagroup reference:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/onlineserv/HB" -
"/beta/HB*" -
"/preprod/HB*" {
Lookup the host based on the HTTP host header
log local0. "host = '[HTTP::host]'"
Check if the host header exists and isn't an IP
if {[string match -nocase {*[a-z]*} [HTTP::host]]}{
set ibHost [class lookup [HTTP::host] USP_IB_REDIRECT_DG]
if { $ibHost != "" } {
log local0. "ibHost found: '$ibHost'"
node $ibHost
} else {
log local0. "ibHost not found"
HTTP::respond 404
}
} else {
SSL::disable serverside
}
}
default {
Default action is to use the VS default pool for non-matching URIs
}
}
}
Aaron