hestiacp icon indicating copy to clipboard operation
hestiacp copied to clipboard

[Bug] Error 403 in nginx points to /error/404.html instead of /error/403.html

Open sahsanu opened this issue 1 year ago • 5 comments

Describe the bug

Today I've realized that a forbidden message (403) in nginx, points to 404.html error page instead of 403.html

I saw it in several files but don't know whether it has been a typo or it is intentional.

# grep -Ril '403\s\/error\/404\.html' /usr/local/hestia/ /etc/nginx/
/usr/local/hestia/install/rpm/templates/web/nginx/php-fpm/prestashop.stpl
/usr/local/hestia/install/rpm/templates/web/nginx/php-fpm/prestashop.tpl
/usr/local/hestia/install/rpm/nginx/nginx.conf
/usr/local/hestia/install/deb/templates/web/nginx/php-fpm/prestashop.stpl
/usr/local/hestia/install/deb/templates/web/nginx/php-fpm/prestashop.tpl
/usr/local/hestia/install/deb/nginx/nginx.conf
/usr/local/hestia/install/upgrade/versions/1.8.0.sh
/usr/local/hestia/nginx/conf/nginx.conf
/usr/local/hestia/data/templates/web/nginx/php-fpm/prestashop.stpl
/usr/local/hestia/data/templates/web/nginx/php-fpm/prestashop.tpl
/etc/nginx/nginx.conf

Tell us how to replicate the bug

Create a file or dir for a web domain without perms and try to access it.

Which components are affected by this bug?

Control Panel Web Interface, (Backend) Web Server (Nginx, Apache2)

Hestia Control Panel Version

1.8.7

Operating system

Debian 12

Log capture

No response

sahsanu avatar Aug 28 '23 17:08 sahsanu

I have no idea..

@myrevery any idea why? It is changed during the RTT update ...

jaapmarcus avatar Aug 31 '23 08:08 jaapmarcus

Caused by #309, #1196.

It's not a big issue, I'll update EOT in a few days, and just change it by the way.

myrevery avatar Aug 31 '23 08:08 myrevery

Caused by #309, #1196.

It's not a big issue, I'll update EOT in a few days, and just change it by the way.

Those are the prestashop changes

But for the Nginx changes it was the RTT PR: https://github.com/hestiacp/hestiacp/blob/04e34fd29bc36a4b59a5216ff05cb4f668119966/install/upgrade/versions/1.8.0.sh#L174-L175

jaapmarcus avatar Aug 31 '23 09:08 jaapmarcus

The error_page 403 pointing to /error/404.html is indeed caused by #309...

See its changes: nginx.conf

The 0-RTT upgrade script part is just for formatting, didn't change it.

myrevery avatar Aug 31 '23 09:08 myrevery

W

jaapmarcus avatar Sep 11 '23 07:09 jaapmarcus