Forum Discussion

KVogel's avatar
KVogel
Icon for Nimbostratus rankNimbostratus
Sep 20, 2019

Set up iRule to direct traffic to an IP address based on URL string

Hi, we would like to set up an iRule to direct traffic based on URL to a list of IP addresses. How would I set that up?

Thank you,

Kim V

1 Reply

  • You can do it like this:

     

    when HTTP_REQUEST {

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

     "abc.domain.com" {

     pool Pool_Number1 }

     "def.domain.com" {

     pool Pool_Number2 }

     }

    }

     

    Or you can use a local traffic policy like this:

    I prefer to use the Local Traffic Policy, because then you can see the pool on the Network Map. The pool doesn't show up on the Network Map with an iRule.