Forum Discussion
balderman82
Nimbostratus
Jun 22, 2018iRule to redirect and select node/pool
I am working on an irule that will redirect users based on the HTTP::path that they enter. The prod rule will direct them to separate pools of servers and redirect them to the same URL. Here is an ex...
Jer-O
Cirrus
Jun 23, 2018I'm not sure if this logic can work as it stands. The reason the pools are ignored is that you are just redirecting the user back to the same virtual server, where the new URI will not trigger the pool select, because there is no condition for eq "/do/login" once they are redirected. Then the problem becomes how to differentiate between someone who started at / and someone who started at /def.
You can solve this by having different login pages for each pool of servers so that you can capture the difference once they are redirected.
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" } { HTTP::redirect "https://app.com/do/login1/" }
elseif { [HTTP::uri] eq "/def" } { HTTP::redirect "https://app.com/do/login2/" }
elseif { [HTTP::uri] starts_with "/do/login1/" } { pool "abc_pool" }
elseif { [HTTP::uri] starts_with "/do/login2/" } { pool "def_pool" }
else { 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