Forum Discussion
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
- nitass_89166
Noctilucent
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.
have you ever used http analyzer tool such as httpfox? it may be useful to find out what is going on.
HttpFox
https://addons.mozilla.org/en-US/firefox/addon/httpfox/- Tom_Farrar_1221
Nimbostratus
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).
- nitass
Employee
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.
have you ever used http analyzer tool such as httpfox? it may be useful to find out what is going on.
HttpFox
https://addons.mozilla.org/en-US/firefox/addon/httpfox/- Tom_Farrar_1221
Nimbostratus
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).
- nitass_89166
Noctilucent
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?
- Tom_Farrar_1221
Nimbostratus
Unhelpfully, it's just a blank page. - nitass_89166
Noctilucent
i suspect request may not hit virtual server.
- nitass
Employee
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?
- Tom_Farrar_1221
Nimbostratus
Unhelpfully, it's just a blank page. - nitass
Employee
i suspect request may not hit virtual server.
- JG
Cumulonimbus
"[HTTP::path]" is the wrong function to use. Should use "[HTTP::uri]" instead.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
