Forum Discussion
Scott_Wozny_894
Jun 15, 2012Nimbostratus
Hi Aaron,
Thanks very much for the advice. It looks like the app is working through the F5 now. The techs still need to test it, but I was able to get everywhere in the app I could find so I think this was the answer. Much obliged.
Scott
In case anyone runs into this problem in the future, here is the final code for the iRule.
-----BEGIN IRULE CODE HERE-----
Translate the hostname of inbound requests from external name to
internal name and port
when HTTP_REQUEST {
if { [HTTP::host] equals "www.rsa.externaldomain.com"} {
log local0. "Replacing Host header [HTTP::host] with internalservername.internaldomain.com:7004"
HTTP::header replace "Host" "internalservername.internaldomain.com:7004"
}
}
when HTTP_RESPONSE {
Translate the redirect location from internal name (and port, if
applicable) to external name
if { [HTTP::header is_redirect]} {
HTTP::header replace Location [string map -nocase {internalservername.internaldomain.com:7004 www.rsa.externaldomain.com internalservername.internaldomain.com www.rsa.externaldomain.com} [HTTP::header value Location]]
log local0. "Replacing Location header internalservername.internaldomain.com with www.rsa.externaldomain.com"
}
Translate payload of response from internal name (and port, if
applicable) to external name
if { [HTTP::header "Content-Type"] starts_with "text/" } {
STREAM::expression "@internalservername.internaldomain.com:7004@www.rsa.externaldomain.com@"
STREAM::enable
log local0. "[IP::client_addr]:[TCP::client_port]: Enabled stream filter for internalservername.internaldomain.com:7004 -> www.rsa.externaldomain.com"
}
}
-----END IRULE CODE HERE-----