Forum Discussion

michaelw3's avatar
michaelw3
Icon for Nimbostratus rankNimbostratus
Jul 30, 2014

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 } }

 

5 Replies

  • Hi Michael,

     

    that's pretty easy, you have configured SSL-profiles for your HTTP-VS. This is not working at all, even without your redirect iRule. Please remove both SSL-profiles and also the default pool is not required for your HTTP-VS.

     

    Ciao Stefan :)

     

    • nathe's avatar
      nathe
      Icon for Cirrocumulus rankCirrocumulus
      Not on the http VIP but yes on the https one
  • Hi i have the same issue i have configured the below rule but it's not working when HTTP_REQUEST { HTTP::redirect https://[HTTP::host][HTTP::uri] }