NGINX sample config for app.php links doesn't work with SIDs

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
EricMc
Registered User
Posts: 2
Joined: Fri Jul 30, 2021 2:13 pm

NGINX sample config for app.php links doesn't work with SIDs

Post by EricMc »

I'm hosting a private forum using NGINX and until a few days ago, I thought that everything was setup correctly in regard to the links using app.php. However, I noticed that the rewrites/redirects sometimes fail with 404 errors when I'm not logged in. For example when I'm trying to access the FAQ or attempting a password recovery. This only happens when the displayed links are followed by the SID parameter, when I remove the SID part, it works as expected.

Now, I've read that the SID in the query string can point to faulty cookie settings and I checked them multiple times and can't really find any problems with them. I don't get the SID parameter when I'm signed in either, just before signing in. I think that this works as intended, but please correct me if I'm wrong.

To rule out other problems with my configuration, I've setup a local instance of phpBB3 using the recommended sample configuration for NGINX and I can still reproduce the problem. Can anybody confirm that the sample configuration works for them even when users aren't logged in and the SID parameter is used? Or should guests never see the SID parameter in the first place?
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: NGINX sample config for app.php links doesn't work with SIDs

Post by AlfredoRamos »

Which phpBB version and sample configuration file are you using? Is you board located in a subdirectory? What does the error log say?

This should work, I'm running 3 boards with that sample configuration file (nginx mainline 1.21.1).

https://github.com/phpbb/phpbb/blob/3.3 ... ample.conf
EricMc wrote: Fri Jul 30, 2021 3:13 pm Can anybody confirm that the sample configuration works for them even when users aren't logged in and the SID parameter is used?
I can confirm it works as expected (while being logged out).

Image

That's my test server, but in the live boards I manage, that works too.
EricMc wrote: Fri Jul 30, 2021 3:13 pm Or should guests never see the SID parameter in the first place?
If guests see the SID on all URLs, then there's something wrong.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26502
Joined: Fri Aug 29, 2008 9:49 am

Re: NGINX sample config for app.php links doesn't work with SIDs

Post by Mick »

A link to your board would help so we can check your cookies.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
EricMc
Registered User
Posts: 2
Joined: Fri Jul 30, 2021 2:13 pm

Re: NGINX sample config for app.php links doesn't work with SIDs

Post by EricMc »

AlfredoRamos wrote: Fri Jul 30, 2021 4:42 pm This should work, I'm running 3 boards with that sample configuration file (nginx mainline 1.21.1).

https://github.com/phpbb/phpbb/blob/3.3 ... ample.conf
I was about to post that this was the same configuration I use, but on closer inspection I noticed that I had added =404 to the end of the try_files directives where it was missing. NGINX was complaining about a redirection cycle when it was trying to access a non-existing favicon.ico without it.

Turns out, that small change of mine is exactly what caused my problem. Sorry for the false alarm, it was completely my fault and not a problem with the sample configuration.
AlfredoRamos wrote: Fri Jul 30, 2021 4:42 pm I can confirm it works as expected (while being logged out).
Thank you for trying to reproduce this and steering me to the right direction. Without your post I'd still be convinced that the rewrite command had to be modified somehow to work with SID parameters.
Mick wrote: Fri Jul 30, 2021 5:48 pm A link to your board would help so we can check your cookies.
I was able to find what was wrong with my configuration, but thank you for offering your help!
Post Reply

Return to “[3.3.x] Support Forum”