Forum Discussion

Gary_Walderich_'s avatar
Gary_Walderich_
Icon for Nimbostratus rankNimbostratus
Apr 24, 2007

Help with creating http to https iRule redirect

I have an https virtual server that is 10.55.1.51 that contains a http service pool and a single node 10.110.240.66.

 

 

The problem I am experiencing is when a user access the virtual server over 443, and continues browsing the site, the user is redirected back to 80, due to how the code is written within the web application. How can I write an iRule to redirect http traffic from the BigIP back to the client as https?

 

 

Example: server --> http --> BigIP --> https --> client

 

 

Many Thanks!

 

-Gary

2 Replies

  • Hi,

     

     

    There is an HTTP to HTTPS redirect example in the codeshare:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPtoHTTPSredirect.html

     

    Click here

     

     

    If you're running 9.4, you can actually do this redirect with an HTTP class on an HTTP VIP.

     

     

    If you want to rewrite the Location header in the response from the web server, you can enable 'rewrite redirects' on the HTTP profile for the VIP. Check the LTM config guide for your version on AskF5.com for details.

     

     

    Lastly, if you want to rewrite HTTP links to HTTPS in the content of the response, you can use the stream profile. Again, the LTM config guide should have details on this.

     

     

    Aaron
  • Thanks Aaron, I am actually running 9.1.2. I will try what you referenced above.

     

     

    -Gary