Forum Discussion

adrian_171483's avatar
Mar 03, 2015

muliple URL's to different pools - one VIP

I have a requirement for some URL's to point to a single VIP I need to write an Irule to accomodate a number of URL's that use the same vip but point down to Server side VIP's

 

so far I am thinking something like this ??

 

We have to client SSL offload and then re-crypt on the Serverside..

 

There is no default pool.. every URL matches to a pool using an FQDN node.

 

when HTTP_REQUEST { switch -glob -- [string tolower [HTTP::uri]] { "mysite1.mydomain.com" { pool MYPOOL-1 } "mysite2.mydomain.com" { pool MYPOOL-2 } } }

 

8 Replies

  • It looks like you are wanting to direct to pool by host name, not URI. In that case you would do something like this. You also don't need

    glob
    unless you are going to use wildcards(*). In your case, it would be more efficient to ommit the glob.

    when HTTP_REQUEST {
        switch -- [string tolower [HTTP::host]] {
            "mysite1.mydomain.com" { pool MYPOOL-1 }
            "mysite2.mydomain.com" { pool MYPOOL-2 }
        }
    }
    
    • Brad_Parker_139's avatar
      Brad_Parker_139
      Icon for Nacreous rankNacreous
      If you know that every host name matches a pool that you have created with the same FQDN you could even do something like this. when HTTP_REQUEST { pool [string tolower [HTTP::host]] }
    • adrian_171483's avatar
      adrian_171483
      Icon for Cirrus rankCirrus
      Thanks.. it is the case that two of the hostnames direct to the same Pool .. so is is possible to forward like this: when HTTP_REQUEST { switch -- [string tolower [HTTP::host]] { "mysite1.mydomain.com" "mysite3.mydomain.com" { pool MYPOOL-1 } "mysite2.mydomain.com" { pool MYPOOL-2 } } }
    • Brad_Parker_139's avatar
      Brad_Parker_139
      Icon for Nacreous rankNacreous
      This will accomplish that for you you need a dash between the two, when HTTP_REQUEST { switch -- [string tolower [HTTP::host]] { "mysite1.mydomain.com" - "mysite3.mydomain.com" { pool MYPOOL-1 } "mysite2.mydomain.com" { pool MYPOOL-2 } } }
  • It looks like you are wanting to direct to pool by host name, not URI. In that case you would do something like this. You also don't need

    glob
    unless you are going to use wildcards(*). In your case, it would be more efficient to ommit the glob.

    when HTTP_REQUEST {
        switch -- [string tolower [HTTP::host]] {
            "mysite1.mydomain.com" { pool MYPOOL-1 }
            "mysite2.mydomain.com" { pool MYPOOL-2 }
        }
    }
    
    • Brad_Parker's avatar
      Brad_Parker
      Icon for Cirrus rankCirrus
      If you know that every host name matches a pool that you have created with the same FQDN you could even do something like this. when HTTP_REQUEST { pool [string tolower [HTTP::host]] }
    • adrian_171483's avatar
      adrian_171483
      Icon for Cirrus rankCirrus
      Thanks.. it is the case that two of the hostnames direct to the same Pool .. so is is possible to forward like this: when HTTP_REQUEST { switch -- [string tolower [HTTP::host]] { "mysite1.mydomain.com" "mysite3.mydomain.com" { pool MYPOOL-1 } "mysite2.mydomain.com" { pool MYPOOL-2 } } }
    • Brad_Parker's avatar
      Brad_Parker
      Icon for Cirrus rankCirrus
      This will accomplish that for you you need a dash between the two, when HTTP_REQUEST { switch -- [string tolower [HTTP::host]] { "mysite1.mydomain.com" - "mysite3.mydomain.com" { pool MYPOOL-1 } "mysite2.mydomain.com" { pool MYPOOL-2 } } }