Forum Discussion
Phaneath_Phour1
Nimbostratus
Aug 17, 2018Redirect HTTP to HTTPS
Hello DC,
I'm new with F5 iRule. And right now, I have an application using http port 8080 and I would like to use SSL offload between client to F5 and keep the same port 8080 with https.
I...
quantiti_170569
Nimbostratus
Aug 21, 2018You should create a Virtual Server listen on 8080 without SSL offload and assign an irule/LTM policty to redirect all HTTP request to HTTPS request at another port ( e.g 8443).
when HTTP_REQUEST {
HTTP::redirect "https://[HTTP::host]:8443[HTTP::uri]"
}
Create another Virtual Server listen on another port (8443) with SSL offload and assign this irule to rewrite redirect port if has
when HTTP_RESPONSE {
Check if server response is a redirect
if { [HTTP::header is_redirect]} {
HTTP::header replace Location https://[string map {"http://" ""} [string map ":[TCP::remote_port]/ :8443/" [HTTP::header value Location]]]
}
}
Phaneath_Phour1
Nimbostratus
Aug 24, 2018Hello Quantiti,
It fixed my problem with iRule now. Thank you so much!!
Best Regards, Phaneath
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