Forum Discussion

Tom_Farrar_1221's avatar
Tom_Farrar_1221
Icon for Nimbostratus rankNimbostratus
Aug 04, 2014

HTTP::redirect occasionally fails

Hi All,

Very occasionally our HTTP::redirect iRule appears to fail to redirect HTTP traffic to HTTPS. The remedy tends to be refreshing the page, which then picks up the redirect and everything is great again.

Here is the iRule:

when HTTP_REQUEST {

if {[string tolower [HTTP::path]] starts_with "/x"} {
         return }
elseif {[string tolower [HTTP::path]] starts_with "/y"} {
         return }
                HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}

I can only recreate it very rarely, but enough people have seen the behavior to make me believe I'm not the only one affected and that there is something more to it.

The logic of the iRule is fairly straight forward.... If path starts with /x or /y don't redirect to HTTPS, but if it's anything else then do.

What I'm seeing is when I hit 'http://madeup.madeupdomain.com' it doesn't redirect to HTTPS. One refresh of the browser later and it redirects fine.

In terms of frequency, I'd say it happens 1 in 1000.

Any ideas gratefully received!

11 Replies

    • Tom_Farrar_1221's avatar
      Tom_Farrar_1221
      Icon for Nimbostratus rankNimbostratus
      Thanks Nitass. I've already tried catching the problem using Live Headers and the web developer toolkit, but typically I've never got it running when I finally get it to trigger (which tends to be the day after I've spent an hour mucking around trying to trigger it).
    • Tom_Farrar_1221's avatar
      Tom_Farrar_1221
      Icon for Nimbostratus rankNimbostratus
      Thanks Nitass. I've already tried catching the problem using Live Headers and the web developer toolkit, but typically I've never got it running when I finally get it to trigger (which tends to be the day after I've spent an hour mucking around trying to trigger it).
  • I've already tried catching the problem using Live Headers and the web developer toolkit, but typically I've never got it running when I finally get it to trigger

     

    when it (redirect) is not triggered, what do you get? is it html page from server (pool member), blank page, error page or anything else?

     

  • I've already tried catching the problem using Live Headers and the web developer toolkit, but typically I've never got it running when I finally get it to trigger

     

    when it (redirect) is not triggered, what do you get? is it html page from server (pool member), blank page, error page or anything else?

     

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    "[HTTP::path]" is the wrong function to use. Should use "[HTTP::uri]" instead.