Mike_Maher
Aug 29, 2005Nimbostratus
HTTP:header replace
We are trying to replace a HTTP header that is being sent to a port other than 80 on a web server, and we are trying to change the header so that it is sent out on port 80 to a Traffic Shield. List below is an example of what we are trying to do and the code we currently have. Any suggestions.
wwwmysite.com:2000 to yoursite2000.com (which would just be 80)
wwwmysite.com:2001 to yoursite2001.com
when HTTP_REQUEST {
set names [HTTP::header names]
log $names
set my_port [TCP::local_port]
set my_host [string tolower [HTTP::host]]
set host_port $my_host
set matchedhost [findclass $host_port $::hostclass =]
if { $matchedhost ne ""} {
set new_host $matchedhost
HTTP::header replace "Host" $new_host}
log [HTTP::host]
}