Forum Discussion
ramann_75062
Nimbostratus
Nov 14, 2008check the used protocol and add new header filed
Hi together,
is it possible to check the used protocol (http or https) from a request and then, based of the kind uof protocol, add a field into the header and send it to the server pool?
Example:
If https is used set new feld proto=1, of http is used, set new field proto=0
Thanks
bjoern
2 Replies
- dennypayne
Employee
Hi Bjoern,
I would think you could use [TCP::client_port] and check for it to be 443 and then add the header, of course if you're using a non-standard port that would need to be accounted for. Or you could check to see if [SSL::sessionid] exists. Then just use the HTTP::header command to add the header you want.
Syntax for all these in the wiki: (Click here).
Denny - ramann_75062
Nimbostratus
yeah, this works:
when HTTP_REQUEST {
if { [TCP::local_port] == 443 }{
HTTP::header insert SSL 1
} else { HTTP::header insert SSL 0}
}
thanks
bjoern
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