3.2.8, nginx, 500 errors (rewrite or internal redirection cycle)

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
rrrkkk
Registered User
Posts: 1
Joined: Tue Feb 11, 2020 7:00 am

3.2.8, nginx, 500 errors (rewrite or internal redirection cycle)

Post by rrrkkk »

Hi, I have 3.2.8 installation on nginx server. I used the recommeneded nginx configuration, the most relevant parts for this issue (I think) are below:
location / {
index index.php index.html index.htm;
try_files $uri $uri/ @rewriteapp;
}

location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
I see some crawlers trying access the board and getting a 500 error code, like:
[error] ...#...: *... rewrite or internal redirection cycle while redirect to named location "@rewriteapp", client: ..., server: forum..., request: "GET /app.php/feed/topic/701 HTTP/1.1"
What can be seen in a debug log is, that first server tries to find file /app.php/feed/topic/701 (which does not exist). That is eventually passed to @rewriteapp, which spits out /app.php//app.php/feed/topic/701 (which does not exist). That is then passed to @rewriteapp again and the loop is formed. Then the nginx catches this and issues 500.

Essentially the same happens also with clients trying access an unexisting file, say for example /apple-touch-icon.png.

Now one possibility to break this loop gracefully might be adding =404 at the end of try_files, like:
try_files $uri $uri/ @rewriteapp =404;
but I have no idea if this would break something else? I ran some quick tests and nothing broke down but of course I do not know the phpBB software that well.

Any advice?

Post Reply

Return to “[3.2.x] Support Forum”