if HTTPS route to specified pool

I am trying to use a nested If statement to route to specific pools. In one situation, if the url is https:xxx then I want to route to different pool. Can this be done?

Here is an example of what I am trying to do:

when HTTP_REQUEST {

if { [HTTP::host] eq “vs1.domain.com”} {

pool pool1

} elseif { [HTTP::host] eq “vs2.domain.com”} {

pool pool2

} elseif { [HTTP::host] eq “vs3.domain.com”} {

pool pool3

} elseif { [HTTPS::host] eq “vs.domain.com”} {

pool pool3ssl

} else {

pool defaultpool

}

}

Thanks in advance for any advice.

The one issue I see with your rule is that there is no “HTTPS::host” variable. You’ll have to check the “TCP::local_port” value to check whether this is on port 443 (https) or not.

ie.

when HTTP_REQUEST {
  if { [HTTP::host] eq "vs1.domain.com"} {
    pool pool1
  } elseif { [HTTP::host] eq "vs2.domain.com"} {
    pool pool2
  } elseif { [HTTP::host] eq "vs3.domain.com"} {
    pool pool3
  } elseif { ([TCP::local_port] == 443) and ([HTTP::host] eq "vs.domain.com") } {
    pool pool3ssl
  } else {
    pool defaultpool
  }
}

-Joe