New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
any way to solve "redirect loop" problem on server side ?
Hi, recently I was reconfiguring something on server but for unknown reason , got problem of "redirect loop" few times.
problem can be easily solved by clear cookies, yes.
but I have very good reason to believe that my viewer are knowing nothing of computer or browser.
so instead of , painfully teach them how to clear cookies , is there any way I can solve this problem on server side ?
maybe something in HTTP header ? something in .htaccess ?
Comments
Could you elaborate? What software are you running?
Yes. Rewrite your software to force all cookies removed for next X days, if it doesn't have a timestamp, abusing XmlHttpRequest() to try to do so.
Or, you know, just invalidate everybody until August, and tell them it's due to new security implementation.
Or admit that you fucked up after clearing their cookies.
thanks for reply,
I use Nginx + Apache + PHP.
after looking around, I guess it's something to do about HTTP to HTTPS redirection.
so I setup HSTS to force HTTPS now, and turned off redirect HTTP to HTTPS.
right now the only redirect I have right now is from domain.com to www.domain.com , and let HSTS to handle HTTPS.
I think , it should works fine now , well , but time will tell if it works out or not.
But I was thinking , if there is anyway I can resolve this problem in case it is already happening.
Yes , I admit, I fucked up something , which I don't even have clue about.
Usually this is an issue with your nginx config.
If you are using wordpress try this: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04
thanks for the help , but I ain't using WP.
and , never thought , WP can be installed in such ... complicated ways ....
@qtwrk Did you get everything to work? You're using HSTS headers to force SSL now it seems?
Would be helpful if you were to post your Nginx config.
He could play rouLETte and post his user and ssh key
Redirect loop for only some sessions, unless caused by, well, a redirect in server configuration of .htaccess override, that would usually affect all visitors, would be caused by something code related, so usually not something you can fix server side without fixing your code.
Can't say much more than that - there's not enough details.
and http header
all i know is : if is evil (https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/)
thus, use return instead of rewrite (https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/)
edit: why do you put the redirect for https with listen 443? it should be with listen 80 in different server block
xd
Edit: listen to @aboanas93. You put the rewrite in the HTTP (port 80) block.