Forum Discussion

Mohammed_M_Irfa's avatar
Mohammed_M_Irfa
Icon for Nimbostratus rankNimbostratus
Aug 10, 2018

HTTPS request is getting redirect to HTTP

Hi,

 

I have configured VS:443, applied default http profile and SSL Client certification.

 

When i hit the ULR as but its redirect to http.

 

7 Replies

  • Strange. To test remove the SSL and http profiles, does it still happen? If so, your webserver is doing the redirect. If not, post your original config. Lastly, tcpdump dump the client, vs and servers IPs from the f5 to determine which device is doing the redirect.

     

    • Mohammed_M_Irfa's avatar
      Mohammed_M_Irfa
      Icon for Nimbostratus rankNimbostratus

      Thanks for instant response Dan!!

       

      Issue is resolved, i have enabled "redirect rewrite" in http profile.

       

      but i wanna know In-depth about this http profile parameters?

       

    • Dan_Pacheco's avatar
      Dan_Pacheco
      Icon for Cirrus rankCirrus

      The link and info below should help clarify the feature. I suspect that the webserver is sending a 302 redirect back to the client. That 302 redirect references an HTTP resource. Enabling the "redirect rewrite" changes the 302 response from referencing an HTTP resource to an HTTPS resource. Running Fiddler or HTTPWatch on the client machine without "redirect rewrite" should prove or disprove my hypothesis.

       

      https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-concepts-11-4-0/7.html

       

      Rewrites of HTTP redirections Sometimes, a client request is redirected from the HTTPS protocol to the HTTP protocol, which is a non-secure channel. If you want to ensure that the request remains on a secure channel, you can cause the redirection to be rewritten so that it is redirected back to the HTTPS protocol.

       

      To enable Local Traffic Manager to rewrite HTTP redirections, you use the Rewrite Redirections setting to specify the way that you want the system to handle URIs during the rewrite.

       

      Note that the rewriting of any redirection takes place only in the HTTP Location header of the redirection response, and not in any content of the redirection.

       

      Possible values When configuring Local Traffic Manager to rewrite HTTP redirections, you specify one of these values:

       

      None The system does not rewrite any redirections. This is the default value. All The system rewrites the URI in all HTTP redirect responses. In this case, the system rewrites those URIs as if they matched the originally-requested URIs. Matching The system rewrites the URI in any HTTP redirect responses that match the request URI (minus an optional trailing slash). Nodes The system rewrites the hidden node IP address to a virtual server address, and rewrites the port number. You choose this value when the virtual server is not configured with a Client SSL profile (that is, when the virtual server is configured to process plain HTTP traffic only). Note: For values All, Matching, and Nodes, the system always hides the node IP address. Also, the system hides the node IP address independently of the protocol rewrite, with no regard to the protocol in the original redirection. Examples of rewriting HTTP redirections with the system listening on port 443 This table shows examples of how redirections of client requests are transformed when the BIG-IP system is listening on port 443, and the Rewrite Redirections setting is enabled.

       

      Original RedirectionRewrite of Redirection http://www.myweb.com/myapp/https://www.myweb.com/myapp/ http://www.myweb.com:8080/myapp/https://www.myweb.com/myapp/ Examples of rewriting HTTP redirections with the system listening on port 4443 This table shows examples of how redirections of client requests are transformed when the BIG-IP system is listening on port 443, and the Rewrite Redirections setting is enabled.

       

      Original RedirectionRewrite of Redirection http://www.myweb.com/myapp/https://www.myweb.com:4443/myapp/ http://www.myweb.com:8080/myapp/https://www.myweb.com:4443/myapp/

       

  • Strange. To test remove the SSL and http profiles, does it still happen? If so, your webserver is doing the redirect. If not, post your original config. Lastly, tcpdump dump the client, vs and servers IPs from the f5 to determine which device is doing the redirect.

     

    • Mohammed_M_Irfa's avatar
      Mohammed_M_Irfa
      Icon for Nimbostratus rankNimbostratus

      Thanks for instant response Dan!!

       

      Issue is resolved, i have enabled "redirect rewrite" in http profile.

       

      but i wanna know In-depth about this http profile parameters?

       

    • Dan_Pacheco_163's avatar
      Dan_Pacheco_163
      Icon for Cirrus rankCirrus

      The link and info below should help clarify the feature. I suspect that the webserver is sending a 302 redirect back to the client. That 302 redirect references an HTTP resource. Enabling the "redirect rewrite" changes the 302 response from referencing an HTTP resource to an HTTPS resource. Running Fiddler or HTTPWatch on the client machine without "redirect rewrite" should prove or disprove my hypothesis.

       

      https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-concepts-11-4-0/7.html

       

      Rewrites of HTTP redirections Sometimes, a client request is redirected from the HTTPS protocol to the HTTP protocol, which is a non-secure channel. If you want to ensure that the request remains on a secure channel, you can cause the redirection to be rewritten so that it is redirected back to the HTTPS protocol.

       

      To enable Local Traffic Manager to rewrite HTTP redirections, you use the Rewrite Redirections setting to specify the way that you want the system to handle URIs during the rewrite.

       

      Note that the rewriting of any redirection takes place only in the HTTP Location header of the redirection response, and not in any content of the redirection.

       

      Possible values When configuring Local Traffic Manager to rewrite HTTP redirections, you specify one of these values:

       

      None The system does not rewrite any redirections. This is the default value. All The system rewrites the URI in all HTTP redirect responses. In this case, the system rewrites those URIs as if they matched the originally-requested URIs. Matching The system rewrites the URI in any HTTP redirect responses that match the request URI (minus an optional trailing slash). Nodes The system rewrites the hidden node IP address to a virtual server address, and rewrites the port number. You choose this value when the virtual server is not configured with a Client SSL profile (that is, when the virtual server is configured to process plain HTTP traffic only). Note: For values All, Matching, and Nodes, the system always hides the node IP address. Also, the system hides the node IP address independently of the protocol rewrite, with no regard to the protocol in the original redirection. Examples of rewriting HTTP redirections with the system listening on port 443 This table shows examples of how redirections of client requests are transformed when the BIG-IP system is listening on port 443, and the Rewrite Redirections setting is enabled.

       

      Original RedirectionRewrite of Redirection http://www.myweb.com/myapp/https://www.myweb.com/myapp/ http://www.myweb.com:8080/myapp/https://www.myweb.com/myapp/ Examples of rewriting HTTP redirections with the system listening on port 4443 This table shows examples of how redirections of client requests are transformed when the BIG-IP system is listening on port 443, and the Rewrite Redirections setting is enabled.

       

      Original RedirectionRewrite of Redirection http://www.myweb.com/myapp/https://www.myweb.com:4443/myapp/ http://www.myweb.com:8080/myapp/https://www.myweb.com:4443/myapp/

       

  • Validate the session in chrome developer tool, which is inbuilt function of chrome browser or install fiddler on system.

     

    It will give an idea.