cancel
Showing results for 
Search instead for 
Did you mean: 

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

CarlT
Altostratus
Altostratus

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 1

nathe
Cirrocumulus
Cirrocumulus

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​