Forum Discussion

CarlT's avatar
CarlT
Icon for Altostratus rankAltostratus
Feb 04, 2020

Same VIP - 2 URI's to different pools via irule - HELP

Hi Guys

I am trying to send traffic to 2 different pools depending on the http uri they are trying to reach, the below syntax will not take,

can someone assist

 

when HTTP_REQUEST {

 if { [HTTP::uri] contains "test1.com"} {

   pool "test-pool1"

 }

}

when HTTP_REQUEST {

 if { [HTTP::uri] contains "test2.com""} {

   pool "test-pool2"

 }

}

 

1 Reply

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    CarlT,

    Couple of suggestions. Firstly I think you're using the wrong command (HTTP::uri), you should be using HTTP::host.

    Secondly, you can tidy up the rule by using logic, rather than a duplicate HTTP_ REQUEST event. Using if/elseif instead. See this article for help. ​

    Hope this helps.

    N​