Forum Discussion
Tony2020
Nimbostratus
Aug 30, 2018Redirect to pool based on URI not working
Hi All,
I am having issues with a redirect within an Irule.
Here is what I am trying to do.
If users coming from the internet (not matching datagroup 10.0.0.0/8) and they go to
"/test" ...
PeteWhite
Employee
Aug 30, 2018So 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
}
}
<...>
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects