Forum Discussion
PeteWhite
Aug 30, 2018Employee
So the answer to your issue is that you can set the pool multiple times in the iRule - it will follow the logic to the end of the iRule and only at that point will it send to the allocated pool. In your case you set the pool based on the URI, then you re-set it based on the IP and then the iRule ends.
Soooo.... you should work out your pseudocode so that it logically does what you want and build your iRule appropriately eg
if IP == internal then set pool X
elseif URI == /test then set pool Y
else do something else
The other thing that you can do is to use the
return
command to exit the iRule once you set the pool the first time:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/test" {
pool TESTPOOL_443
return
}
}
<...>