Forum Discussion
nacejj_65488
Oct 20, 2011Nimbostratus
Here's the header rewrite iRule I got from http://devcentral.f5.com/wiki/iRules.rewrite_host_header_to_server_name.ashx
NOTE: This iRule was tested on a previous version and I current am on 10.2.1
when HTTP_REQUEST_SEND {
set host_debug 1
clientside {
if {$host_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: New [HTTP::method] request to [HTTP::host][HTTP::uri]"}
set host_header_value [findclass [LB::server addr] ip_to_host_class " "]
if {$host_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Looked up [LB::server addr], found: $host_header_value."}
if {$host_header_value ne ""}{
HTTP::header replace Host $host_header_value
if {$host_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Replaced Host header with $host_header_value."}
}
}
}
nitass I had already added it to the PC host file.