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!