Forum Discussion
dan_19334
Dec 20, 2010Nimbostratus
determine HTTP or HTTPS
What is the best way to determine if the connection came in HTTP or HTTPS? I want to have a common iRule applied to both port 80 & 443 that redirects the connection to a different location but keeps ...
- Sep 24, 2015
Patrik, good one. You have typo. It should be:
if { [PROFILE::exists clientssl] == 1 } { set protocol "https" } else { set protocol "http" }
I'm doing this on CLIENT_ACCEPTED. The method with CLIENTSSL_HANDSHAKE will not work because BIG-IP refuse to load it on VS without SSL profile.
hooleylist
Dec 20, 2010Cirrostratus
Chris,
I think URI::protocol will only parse the protocol from a full URL that already has the protocol listed. I could imagine it being useful for parsing fully qualified URLs in requests through a web proxy. However, if the client didn't include the protocol in the URI, I expect URI::protocol wouldn't return anything:
when RULE_INIT {
log local0. "\[URI::protocol /path/to/file.ext\]: [URI::protocol /path/to/file.ext]"
log local0. "\[URI::protocol https://www.example.com/path/to/file.ext\]: [URI::protocol https://www.example.com/path/to/file.ext]"
}
: [URI::protocol /path/to/file.ext]:
: [URI::protocol https://www.example.com/path/to/file.ext]: https
Aaron
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