If I understand your scenario correctly, that's close. You just need to strip out the port on requests:
when HTTP_REQUEST {
Remove the port from the host header if present and send a redirect to the same URI
HTTP::redirect "http://[getfield [HTTP::host] : 1][HTTP::uri]"
}
when HTTP_RESPONSE {
Check if response is a redirect baseed on status code
if { [HTTP::header is_redirect]} {
Update the location header by removing the pool member's port
HTTP::header replace Location [string map ":[TCP::server_port]/ /" [HTTP::header value Location]]
}
}
Aaron