Forum Discussion
Steven_87308
Feb 10, 2012Nimbostratus
stuck on first complex irule - req for help
I'm writing to ask for help with the design of an irule solution. My goal is to get various URIs to either redirect to SSL during authentication, or to fail pass http through to a standard pool.
...
Steven_87308
Feb 13, 2012Nimbostratus
Richard, thanks for the reply.
I'm not sure I understand the use of -glob -- wouldn't it be similar to an OR statement in the first IF test? I tried modifying your snippet, but am confused, for it seems to use PATH as a variable, to be found in -glob. If I declare the paths in -glob, I'd still want a redirect, not a path if there is a match. Point is, it doesn't work -- it doesn't redirect, nor on the same path.
IF-OR-Else
when HTTP_REQUEST {
if {{[HTTP::uri] starts_with "/path1"} or {[HTTP::uri] ends_with "/path2"}} {
HTTP::redirect https://[HTTP::host][HTTP::uri]
} else {
pool http_poolX
}
so I tried to do a nest again. Here's what I have, and in terms of parsing, Big-IP likes it and lets me save...
If-elseif
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/path1"} {
HTTP::redirect https://[HTTP::host][HTTP::uri]
} elseif {[HTTP::uri] ends_with "/path2"} {
HTTP::redirect https://[HTTP::host][HTTP::uri]
} else {
pool http_poolX
}
}
These gets me no redirects - it seems to not match, giong straight to a basic (non-ssl) authentication dialog, or sometimes it will say, "Unable to open . Cannot download the information you requested."
Nitass, is your post a proof of concept, if I read correctly? Why wouldn't the above work when -glob does?
Curious,
-Steve
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