One suggestions on that. If the redirect location changes (ie, the URI is dynamically set) and you need to preserve this, you can replace the only host portion of the redirect with the FQDN using a rule like this:
when HTTP_RESPONSE {
if {[HTTP::is_redirect]}{
set domain_name "host.example.com"
log local0. "\[IP::remote_addr\]:\[TCP::remote_port\]: [IP::remote_addr]:[TCP::remote_port]"
set string_map [string map "[IP::remote_addr]:[TCP::remote_port] $domain_name" [HTTP::header value Location]]
log local0. "string map: $string_map"
HTTP::header replace Location [string map "[IP::remote_addr]:[TCP::remote_port] $domain_name" [HTTP::header value Location]]
}
}
Or without logging/intermediate variables:
when HTTP_RESPONSE {
if {[HTTP::is_redirect]}{
HTTP::header replace Location [string map "[IP::remote_addr]:[TCP::remote_port] host.example.com" [HTTP::header value Location]]
}
}
Aaron