Forum Discussion

Michael_107360's avatar
Feb 11, 2014

redirect rewirte option in http profile causing looping

I have enabled the redirect rewrite "ALL" in the http profile so it will redirect http:// to https:// server responses, this is working just fine however it causing the application to loop. Any thoughts? I have also tried to use iRules to accomplish the same thing, and the issue is the same the http gets redirected to https however it loops???

 

6 Replies

  • I have to believe that what you're experiencing is an application specific behavior. The Redirect Rewrite option will catch a redirect from the server and rewrite http:// to https:// in the Location header. But if what you're sending back to the server from the redirect is still not what the application is requiring, then it may attempt to redirect you again, and again, and again... It's difficult to say what that may be though. I've seen applications like SharePoint that only care about the Host header, and apps like Webmin that apparently care about the Host and Referer headers. I would start by examining what the application does in the absence of the proxy layer, and then try to emulate that on the server side of the connection.

     

  • Robin_Mordasie1's avatar
    Robin_Mordasie1
    Historic F5 Account
    Hi MIchael, is it possible that you are testing this feature with an SSL offload configuration, and that backend servers are configured to redirect http requests to https ?
  • this is an ssl offload...the problem is the backend servers are doing redirects to http:// not https://. When I use this options the redirects are in fact https:// as they should be but the app is looping over and over......
  • i can email you the http watch if you like...it is basically doing as you said but it is going to a different url which is by design...or so they say....however the same url has the same ip address which i think may be some of the issue......so in general.....302 https://www.website.com/redirection 302 https://www.websitemoreinformation.com/redirection 302 https://website.com/redirection and over and over and over.....www.website.com and www.websitemoreinformaton.com resolve to the same ip address or virtual server.
  • I ran into this on a project:

    Setup:
    • http and https Virtual Servers
    • http to https redirect irule
    • https offload to http pool
    • http profile with Redirect Rewrite: All
    Problem:
    • Page would not load correctly (html would load but no CSS or images)
    • Fiddler revealed that the application servers were redirecting all content requests to the base uri with a single-sign-on logoff parameter appended...and then redirecting the redirect with a duplicate parameter appended...and then again...
    • It looped like this until the redirect had 10+ duplicate parameters and it finally gave up, but never returned the real content.
    Solution:
    • Finally determined that Redirect Rewrite was rewriting the Referer header to "https://sub.domain.com/path/", which the application (on http) was rejecting/redirecting.
    • Used this iRule to rewrite incoming Referer header to "http://sub.domain.com/path/"
        when HTTP_REQUEST {
        set referer [HTTP::header "Referer"]
        if { $referer starts_with "https://" } {
            set httpReferer "http://[string range $referer 8 end]"
            HTTP::header replace "Referer" $httpReferer
        }
    }