Forum Discussion
TimRiker
Jan 27, 2023Cirrocumulus
We do this to capture and rewrite http to https in http 3xx replies. You might try something similar. The F5 should normally pass the original Host header when it calls a pool member. The applications should be using this value for redirects and links and not their own hostname.
when HTTP_REQUEST {
set hostname [HTTP::host]
}
when HTTP_RESPONSE {
if { ([HTTP::status] starts_with "3") and ([HTTP::header Location] contains $hostname) }{
HTTP::header replace Location [string map {http: https:} [HTTP::header value Location]]
}
}
Side note: example.com, example.org and example.net are available specifically for uses like your example here. Somone owns ourserver.com and may or may not like you linking to it here.
Here's another Dev Central post that might be more what you're looking for:
https://community.f5.com/t5/codeshare/proxypass-lite/ta-p/284093