Forum Discussion
Help with Port Translation
Thanks Ajmal :) JUst curious, how successful have you been getting application owners to fix their redirections to use standard ports :) Anyway I did a search for rewriting the port in an http response and found the following from Hoolio. With some slight modification (just in comments I think) It worked perfectly...
when HTTP_RESPONSE {
Check if server response is a redirect
if { [HTTP::header is_redirect]} {
Log original and updated values
log local0. "Original Location header value: [HTTP::header value Location],\
updated: [string map ":[TCP::remote_port]/ /" [HTTP::header value Location]]"
Do the update, replacing in this case :9443/ with / (where 9443 is the stproxy port)
HTTP::header replace Location [string map ":[TCP::remote_port]/ /" [HTTP::header value Location]]
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com