Forum Discussion
Negating traffic policy rules
Hoping someone can help me out with this. Recently tried deploying a traffic policy to redirect users to https if the URI contains a list of different strings, and to redirect back to http if it does not contain a list of strings.
Logic seemed simple. As an example:
HTTP virtual server: if URI path contains login.php, redirect to the same host/URI over https.
HTTPS virtual server: if URI path NEGATE contains login.php, redirect to same host/URI over http.
The contains works great, but the minute I negate the same rule for my https server, I wind up in a redirect loop. so even if my http request is sent is I get redirected to http, which in turns redirects me back to https, looping me indefinitely. What I expected to happen was the traffic policy would be evaluated and since I was already using HTTPS and my URI contained login.php, I would not get a 302 redirect.
I can get all this to work by changing my negate rule to use STARTS WITH instead of CONTAINS, however this limits me if I need to specify different URI path's that aren't stored at the root of the web server.
Has anyone run into this or can someone explain the the boolean logic for contains and how it changes when it is negated? It is not working as I would expect.
Thanks all,
-GR
- Josiah_39459Historic F5 AccountProbably be easiest if you post your irules and/or add logging to them to log the URI they are receiving at each step so you can trace the logic.
- Old-Greg-MDNimbostratusThey're not irules, using traffic policies. I think I can add logging to them, let me check. It just seems fairly simple. Negating a contains value just isn't functioning as I would have thought and I am not sure why.
- cjuniorNacreous
Hi Greg,
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