Forum Discussion
Aabuitrago
Jun 11, 2019Altostratus
iRule HTTP to HTTPS redirect keep port and uri
Hi, Does anyone knows the correct syntax of an irule to redirect http to https and keeping the port for example http://www.example.com:8443 --> redirect_to --> https://www.example....
Aabuitrago
Altostratus
Hi JG,
thank you for your help. Its a redirect issued by the app server. The app server is sending back the entire URL including the port.
regards,
Lee_Sutcliffe
Jun 13, 2019Nacreous
I would echo everything JG has said.
if an application is issuing a redirect with a local port in the response, it ideally needs fixing on the application.
Reason being, you may end up with absolute HTML references that also need correcting.
That said, if it is just a redirect you could use the following (this is untested as I've written this on my phone)
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
HTTP::header replace Location "https://[getfield [HTTP::host] : 1][HTTP::uri]"
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects