iRules HTTP Redirect to HTTPS
I have configured an irule for http to redirect to https as below but it is not working any advice on how to resolve appreciated.
https works. http with redirect does not work
irule name is Redirect-http
when HTTP_REQUEST { HTTP::redirect https://[HTTP::host][HTTP::uri] }
HTTP Config
ltm virtual Servers-VS-80 { destination 172.19.18.230:http ip-protocol tcp mask 255.255.255.255 pool Servers-443 profiles { clientssl { context clientside } http { } serverssl { context serverside } tcp { } } rules { Redirect-http } vlans-disabled }
ltm pool Servers-443 { members { Server1:https { address 172.19.18.100 session monitor-enabled state up } Server2:https { address 172.19.18.200 session monitor-enabled state down } } monitor min 1 of { https } }
HTTPS Config
ltm virtual Servers-VS-443 { destination 180.38.18.230:https ip-protocol tcp mask 255.255.255.255 pool Caplin-443 profiles { company1.com { context clientside } company1.co.uk { context clientside } Company2.com { context clientside } Server1 { context serverside } Server2 { context serverside } Server3 { context serverside } server4 { context serverside } tcp { } } vlans-disabled }
ltm pool Servers-443 { members { Server1:https { address 172.19.18.100 session monitor-enabled state up } Server2:https { address 172.19.18.200 session monitor-enabled state down } } monitor min 1 of { https } }