Issue with permissions and MIME type on web server with HestiaCP and Nginx

Hello everyone,

I’m experiencing an issue with my web server configured with HestiaCP and Nginx, and I need help to resolve it.

The problem I’m facing is that some files, especially those with extensions like .map, are not being served correctly and are generating permission and MIME type errors in the Nginx error logs.

The specific error I encounter is as follows:

[error] open() "/path/to/file" failed (13: Permission denied), client: CLIENT_IP, server: MY_DOMAIN, request: "GET /path/to/file HTTP/2.0", host: "MY_DOMAIN"

Additionally, I’m also receiving error messages related to MIME type, indicating that the MIME type of the file is not executable:

Refused to execute script from 'FILE_URL' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

I’ve checked the permissions of the relevant files and directories, and I’ve adjusted the permissions as necessary for Nginx to access them. Furthermore, I’ve reviewed the configuration of HestiaCP and Nginx for any settings that might be causing the problem, but I haven’t found any solution.

Has anyone experienced a similar issue before or have any ideas on how to fix it?

Any help or suggestions would be greatly appreciated.

What I’m trying to do is make OwnCloud work on Hestia. I have NGINX with the OwnCloud template and PHP 7.4. I’ve moved it from a CWP server to this Hestia one. I see the login screen and everything seems fine, but it appears to be without styles and doesn’t log in.

Thanks in advance!

I’ve already solved this, it seems it was a permissions error in the directories, simply. But now I’m facing another issue, it keeps loading when logging in until it shows a 500 error. In the log, it only says this:

2024/04/18 21:40:48 [error] 933638#933638: *26 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: *********, server: ******eb.es, request: "POST /index.php/login HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm-********eb.es.sock:", host: "*********eb.es"
2024/04/18 21:46:05 [error] 933638#933638: *26 upstream timed out (110: Connection timed out) while reading response header from upstream, client: ***, server: *******eb.es, request: "POST /index.php/login HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm-************eb.es.sock", host: "********eb.es"

That’s all… any clues?