Forum Discussion
Mike_Maher
Nimbostratus
Aug 29, 2005HTTP: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]
}
- Colin_Walker_12Historic F5 AccountMike,
- Mike_Maher
Nimbostratus
Colin, - Colin_Walker_12Historic F5 AccountGreat news Mike. I'm glad to hear all is working as intended now. Enjoy!
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