Forum Discussion
DarkSideOfTheQ_
Nimbostratus
Feb 23, 2009HTTPS rewrite???
Hello All,
I have two vips setup, one for http and one for https. I've put in place an http to https redirect on the http vip and it is working as expected.
when HTTP_REQUEST {
if { [HTTP::host] equals "test.domain.com" } {
HTTP::redirect https://test.domain.com/app/login.do
}
}
My issue is the https side of things, if someone tries to go to "https://test.domain.com" directly and I try to use the same irule as above on the https vip, I keep getting stuck in a redirect loop. I don't see an HTTP::rewrite command, so how might I go about trying to do a rewrite instead?
TIA,
DarkSide
- The_Bhattman
Nimbostratus
When you look at [HTTP::host] it's going to be true if it looks like thiswhen HTTP_REQUEST { if { ([HTTP::host] equals "test.domain.com") and [HTTP::uri] equals "/" } { HTTP::redirect https://test.domain.com/app/login.do } }
- DarkSideOfTheQ_
Nimbostratus
I appreciate the assistance CB, it certainly helped. I had begun thinking that I might need 2 iRules to accomplish my goal and was uncertain how to handle the https side. Using only one make things much easier. - DarkSideOfTheQ_
Nimbostratus
Ok, as I mentioned this is working, but now they've come back and asked me to do something that should be handled at the app layer. They have a web console that is used to change parameters of the app server. Rather than putting a password on it like they should, they want me to drop any requests attempting to access it. I tried using the 'else' and 'elseif' statements, but they seemed to drop everything. Where have I fallen off the tracks on this???when HTTP_REQUEST { if { ([HTTP::host] equals "test.domain.com") and [HTTP::uri] equals "/" } { HTTP::redirect https://test.domain.com/app/login.do } elseif { ([HTTP::uri] contains "appconsole" or "qaconsole") } { reject } }
when HTTP_REQUEST { if { ([HTTP::host] equals "test.domain.com") and [HTTP::uri] equals "/" } { HTTP::redirect https://test.domain.com/app/login.do } else { reject } }
- lmwf1_55268
Nimbostratus
It looks like because it never get to the elseif line,
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