Forum Discussion
ssenecal_87343
Nimbostratus
Nov 10, 2009get incoming protocol
This is probably a really dumb question, but I can't figure out how to get the incoming HTTP protocol. ie, if the user accesses "http://server.com" I want "http", or if the access "https://server.com" I want "https". Is there a way to do this? Alternatively, if I could get the entire URL that would be even better.
I am trying to append the original URL to a redirect using:
HTTP::respond 302 Location "http://server.com:3080/da/UI/Login?goto=[URI::encode "[HTTP::protocol][HTTP::host][HTTP::uri]"]"
Any ideas?
3 Replies
- hoolio
Cirrostratus
Hi,
That's not a dumb question at all--we had a recent discussion about this topic in this post:
examining the "http://" portion of a url
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=86063
If the VIP you're using the iRule is only used for HTTP you could hardcode it to http://. If it could be used on an http or https VIP, you could either check TCP::local_port for 80 or 443, check [PROFILE::exists clientssl]==1 to see if a client SSL profile is configured on the VIP, or use SSL::cipher to check if the connection was encrypted.
Aaron - ssenecal_87343
Nimbostratus
the SSL::cipher is probably the direction I will go. Thanks! - hoolio
Cirrostratus
Just to clarify, SSL::cipher will only work for a VIP which has a client SSL profile enabled. So the scenario you would use SSL::cipher to determine whether the clientside connection was using SSL is if you had a client SSL profile configured with the non-ssl option enabled.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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