404 not found for user/reset_password?u=xx&token=yyy

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
User avatar
gianluigi.zanettini
Registered User
Posts: 113
Joined: Fri Sep 07, 2007 9:09 pm
Location: Ferrara, Italy
Contact:

404 not found for user/reset_password?u=xx&token=yyy

Post by gianluigi.zanettini »

I've a problem with the reset_password URL sent via email after the user uses the"forget password" functionality: the page "works" when called without parameters https://turbolab.it/forum/user/reset_password , but if I even add just the user parameter ( https://turbolab.it/forum/user/reset_password?u=2 ) it returns a 404 error

Image

Same thing with the complete querystring https://turbolab.it/forum/user/reset_pa ... &token=yyy .

All my other pages work just fine (eg: https://turbolab.it/forum/viewtopic.php ... &start=275 )

This is a phpBB 3.3.1 installation running on nginx with PHP 7.4.

I've enabled Server -> url_rewrite to prevent the app.php file in the URL. If I disable it, the URL received by email has the app.php part, but the result is always a 404 page.

My nginx config:

Code: Select all

## phpBB Nginx from https://www.phpbb.com/community/viewtopic.php?t=2508711
#
location /forum/ {

	try_files $uri $uri/ @rewriteapp;

	location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) {
		deny all;
	}

	location ~ \.php/(|$) {

        include fastcgi_params;
        fastcgi_intercept_errors on;
		fastcgi_param SCRIPT_FILENAME $request_filename;
		try_files $uri $uri/ /forum/app.php$is_args$args $document_root$fastcgi_script_name =404;
		fastcgi_pass unix:/run/php/php-fpm.sock;
	}
}

location @rewriteapp {
	rewrite ^(.*)$ /forum/app.php/$1 last;
}

location /forum/install/ {
	try_files $uri $uri/ @rewrite_installapp;

    	location ~ \.php/(|$) {

            include fastcgi_params;
            fastcgi_intercept_errors on;
            fastcgi_param SCRIPT_FILENAME $request_filename;
            try_files $uri $uri/ /forum/install/app.php$is_args$args $document_root$fastcgi_script_name =404;
            fastcgi_pass unix:/run/php/php-fpm.sock;
        }
}

location @rewrite_installapp {
	rewrite ^(.*)$ /forum/install/app.php/$1 last;
}
Thanks for your help.
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 1022
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: 404 not found for user/reset_password?u=xx&token=yyy

Post by AbaddonOrmuz »

Try adding the /forum/ path to the regexp:

Code: Select all

location @rewriteapp {
	rewrite ^/forum/(.+?)$ /forum/app.php/$1 last;
}
The same for @rewrite_installapp:

Code: Select all

location @rewrite_installapp {
	rewrite ^/forum/install/(.+?)$ /forum/install/app.php/$1 last;
}
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
gianluigi.zanettini
Registered User
Posts: 113
Joined: Fri Sep 07, 2007 9:09 pm
Location: Ferrara, Italy
Contact:

Re: 404 not found for user/reset_password?u=xx&token=yyy

Post by gianluigi.zanettini »

Hi AbaddonOrmuz,
thanks for your reply. My configuration was actually based on one of your posts. So... thanks for that! :D

I just fixed it on my own. I'm now using this configuration, based on the official one by phpBB. I'm not really sure why, but now everything works as expected.
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 1022
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: 404 not found for user/reset_password?u=xx&token=yyy

Post by AbaddonOrmuz »

gianluigi.zanettini wrote:
Fri Aug 28, 2020 10:22 pm
My configuration was actually based on one of your posts. So... thanks for that! :D
You're welcome :wink:
gianluigi.zanettini wrote:
Fri Aug 28, 2020 10:22 pm
I just fixed it on my own. I'm now using this configuration, based on the official one by phpBB. I'm not really sure why, but now everything works as expected.
I actually contributed to the official one, so if there's something that needs to be fixed, it would be good if you could send a pull request.

https://github.com/phpbb/phpbb/blob/3.3 ... ample.conf

Especially since I've seen that more people use Nginx for phpBB nowadays.
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
Post Reply

Return to “[3.3.x] Support Forum”