04-May-2020 15:58
I am trying to create a one Virtual server which can listen on http and https , on http it needs to redirect the request to https.
On https VS I want to do ssl bridging, I believe I need an irule for this.
when CLIENT_ACCEPTED {
set https 0
}
when CLIENTSSL_HANDSHAKE {
set https 1
}
when HTTP_REQUEST {
if {not ($https)}{
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
else {
SSL::profile clientssl_profile
SSL::profile serverssl_profile
pool $Poolname
}
}
Can this irule work ? if not what changes I need here.
05-May-2020
00:10
- last edited on
04-Jun-2023
21:28
by
JimmyPackets
You can simply use the default http2https irule,
create ltm virtual APP-80-SETUP destination 1.1.1.1:80 profiles replace-all-with { http } rules { http2https }
create ltm virtual APP-443-SETUP destination 1.1.1.1:443 mask 255.255.255.255 ip-protocol tcp profiles add { clientssl serverssl http-xff } pool APP-443-POOL profiles add { tcp-wan-optimized { context clientside } tcp-lan-optimized { context serverside } }
05-May-2020 07:43
Thing is I can only have one server which listens on same port for HTTP and HTTPS, Traffic will be coming to that port only.
05-May-2020 09:00
Here follow this article.
https://devcentral.f5.com/s/articles/handling-http-requests-on-an-https-virtual-server-31668