For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Rafish_129330's avatar
Rafish_129330
Icon for Nimbostratus rankNimbostratus
Dec 11, 2013

http to https redirect

Hi, I new in irule and i want every time that client do this "http://myserver.com" the F5 will redirect to "https://myserver.com". I chenged my virtual server and now he is listening to http and in the policy i put the default i rule _sys_https_redirect . But its not working.

 

can some explain how to use this irule ? I don't know if it impotent but i use all sow SSL Profile (Client) (i have certificate to the server)

 

Regards Rafi

 

7 Replies

  • Hello Rafi,

     

    Can you please clarify if your new virtual server is http or https. SSL profile on the virtual server suggest that you have https. As far as I understand, SSL Profile on http would not work (unless you type https://VS.IP:80 ).

     

    Os

     

  • Hi,

     

    At first i configured my virtual server as HTTPS and with certificate. When try to go to web page withe https it works. But now i want to allow my client to write http://servername.com and the F5 will redirect the http to https.

     

    i still need the ssl certificate in the server.

     

    Regards Rafi

     

  • Hello Rafi,

     

    You need two virtual servers.

     

    VS-servername.com:HTTP ---Apply iRule _sys_https_redirect. VS-servername.com:HTTPS ---Apply ssl profile here.

     

    You'll get a redirect to https if you access http://servername.com Also, you'll be able to access https://servername.com

     

    Os

     

    • Rasool1224's avatar
      Rasool1224
      Icon for Nimbostratus rankNimbostratus
      Hi there, I do face same problem, as per above answer, What I understood is, 1. create one VS_with_http_port. 2. create another VS_with_https_port and adding same nodes. but in 1 you advised to apply iRule_sys_https_redirect, my question is what should I write in the below field in the iRule HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] finally which VS should I apply ASM policy. kindly update thank you & prompt response is much appreciated. Regards, Gulam
  • Hi,

     

    I succeed to do the redirect but i still need the certificate because the pool member is member:443.

     

    I configured the first VS as you suggested and the http was redirect to https but the web page didn't open because i must certificate.

     

    Is it possible to do what i want ?

     

    Regards Rafi

     

  • Hi,

     

    If the front-end web server is listening on 443 then on VS-servername.com:HTTPS you need to modify the SSL Profile (Server) to serverssl.

     

    Os