Forum Discussion
Janek_42109
Nimbostratus
Oct 03, 2014Insert custom HTTP header determined by VS protocol
Dear all,
I have two VS sending the traffic to the same pool server. The idea was to be able to identify from the log server from which VS (HTTP or HTTPS) the traffic was coming from.
So I implem...
Kevin_Stewart
Employee
Oct 03, 2014There are potentially two problems:
-
You've defined a local variable called "proto", but then accessing it as "PROTO". TCL is case sensitive.
-
I've found that many versions of IIS don't like headers with underscores in them. It will natively replace dashes with underscores, but doesn't seem to like it when the header names arrive with underscores.
Try this:
when CLIENT_ACCEPTED {
switch [TCP::local_port] {
"443" {
set proto "https"
}
"80" {
set proto "http"
}
}
}
when HTTP_REQUEST {
HTTP::header insert VS-HTTP-PROTO $proto
}
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