[phpBB3] Nginx upgrade causes redirect loop
[phpBB3] Nginx upgrade causes redirect loop
I have a phpBB3 forum running on Apache (port 8080), with Nginx as the reverse proxy for static content (on port 80). This was all working fine until I tried upgrading Nginx to the latest version (1.2.0). After upgrading, the homepage gets stuck in an endless loop of 301 redirects. This only affects the homepage, all other pages are still working, and this only happens when the Magic SEO URLs plug-in is enabled -- when I disable it, the homepage works fine, but all other forum URLs are obviously not rewritten.
Do you have any ideas as to what in Magic SEO URLs could be causing the homepage to endlessly redirect to itself? The Apache mod_rewrite rules haven't changed. Unfortunately, I cannot show this in action, because then my forum homepage would be inaccessible. I've downgraded Nginx back to the previous stable release, but would like to be able to upgrade.
Any help would be appreciated. Perhaps you can point me in a direction so that I can continue investigating. Currently, I'm stuck.
Do you have any ideas as to what in Magic SEO URLs could be causing the homepage to endlessly redirect to itself? The Apache mod_rewrite rules haven't changed. Unfortunately, I cannot show this in action, because then my forum homepage would be inaccessible. I've downgraded Nginx back to the previous stable release, but would like to be able to upgrade.
Any help would be appreciated. Perhaps you can point me in a direction so that I can continue investigating. Currently, I'm stuck.
Re: [phpBB3] Nginx upgrade causes redirect loop
If you mean by "disabling" commenting out installation line in common.php file and leaving .htaccess file intact then it seems there is a bug in Nginx - some server vars are getting incorrect values.
Link to phpinfo.php page would help in pointing what exactly is going wrong there.
Link to phpinfo.php page would help in pointing what exactly is going wrong there.
Re: [phpBB3] Nginx upgrade causes redirect loop
It's a strange problem, the cause of which must be somewhere in the middle between Magic SEO URLs and the new Nginx, but I don't think I'll ever get to it. I've compared the server variables and headers, but don't see anything that could cause this. However, since it's only affecting the homepage, I managed to come up with a workaround:
This returns a 404 for every hit to http://www.example.com/ only (i.e. the homepage), and for every 404 I have a fallback function like this, redirecting to Apache:
It works, so I'm happy. Thanks for your time.
Code: Select all
if ($request_filename ~ \/$) {
return 404;
}
This returns a 404 for every hit to http://www.example.com/ only (i.e. the homepage), and for every 404 I have a fallback function like this, redirecting to Apache:
Code: Select all
error_page 404 = @fallback;
location @fallback {
proxy_pass http://127.0.0.1:8080;
}
It works, so I'm happy. Thanks for your time.