Forum Discussion

Bob_10976's avatar
Bob_10976
Icon for Nimbostratus rankNimbostratus
Feb 09, 2012

Redirect to different Pool based on Host

Hello all...

I'm in the process of migrating several site from one server group to another, and since I'm only doing a few at a time I want to be able to redirect request for those sites that have been moved to the new pool and the not default pool. I have a similar rediret rule that I've used based on path, however I'm thinking I can simply change the "path" to "host", would that be correct?


when HTTP_REQUEST {
    switch -glob "[string tolower [HTTP::path]]" {
"/bob*" -
"/shopping*"  {
pool secure2.test.domain.com
 }
default {
pool secure.test.domain.com
 
    }
  }
}

Thanks,

Bob

  • yes, it should work just fine.

    e.g.

    when HTTP_REQUEST {
       switch [string tolower [HTTP::host]] {
          "new.domain.com" {
             pool new_pool 
          }
          default {
             pool default_pool
          }
       }
    }
    
  • Thanks for the confirmation..

     

     

    I did put in place and appears to be working as expected..

     

     

    Thanks,

     

    Bob

     

     

  • when HTTP_REQUEST {

     

    switch [string tolower [HTTP::host]] {

     

    "career.mycompany.com" {

     

    Use pool1

     

    pool Pool1

     

    }

     

    "support.mycompany.com" {

     

    Use pool2

     

    pool Pool2

     

    }

     

    "help.mycompany.com" {

     

    Use default pool

     

    pool pool3

     

    }

     

    }

     

    }