Forum Discussion
Policy action getting overwrote by irule
- May 08, 2019
I found the solution. You can find if a pool is already selected.
[LB::server pool] will give you the name of the pool selected (or nothing) for example: /Common/example-com-pool
So the solution in my case to avoid the default case to overwrite what my policy did.
default { if { ! ([LB::server pool] starts_with "/Common/") } { log local0. "DEBUG – pool not selected" HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]" } }
NB: For the random googler coming accros this question you can also catch if a redirect was already performed (by your policy) with this ([catch {HTTP::payload replace 0 0 {}}])
I found the solution. You can find if a pool is already selected.
[LB::server pool] will give you the name of the pool selected (or nothing) for example: /Common/example-com-pool
So the solution in my case to avoid the default case to overwrite what my policy did.
default {
if { ! ([LB::server pool] starts_with "/Common/") } {
log local0. "DEBUG – pool not selected"
HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]"
}
}
NB: For the random googler coming accros this question you can also catch if a redirect was already performed (by your policy) with this ([catch {HTTP::payload replace 0 0 {}}])
Recent Discussions
Related Content
* 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