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

Humair_167681's avatar
Humair_167681
Icon for Nimbostratus rankNimbostratus
Sep 05, 2014

HTTP redirection issue

Hi all,

 

I was wondering if someone could help me fix a http redirection issue.

 

Basically, we are terminating https/ssl connections on the LTM. Then the LTM talks to the server using http. The problem occurs when the application running on the server asks the client to get a resource on http. Since the LTM is only listening to https, the communication breaks.

 

2 Replies

  • There's generally two ways to handle this, both depending on how the information is presented to the client.

    For HTTP 30x redirects, the Redirect Rewrite setting in the HTTP profile will automatically rewrite http:// to https:// in outgoing redirect Location headers.

    For everything else, you'd need an iRule and a STREAM profile. Insert an empty STREAM profile into the VIP's configuration and an iRule like this:

    when HTTP_REQUEST {
        HTTP::header remove Accept-Encoding
        STREAM::disable
    }
    when HTTP_RESPONSE {
        if { [HTTP::header Content-Type] contains "text" } {
            STREAM::expression {@http://@https://@}
            STREAM::enable
        }
    }
    

    This works by enabling the STREAM profile on egress text-based traffic only to replace any instance of "http://" with "https://" in the response payload.