Glam Prestige Journal

Bright entertainment trends with youth appeal.

Answer in comments, I didn't have the correct permissions set.

Moved from Stack Overflow

My website, returns a 404 error for everything other than index.html. This includes files such as pictures which can be confirmed in the network tab of inspect element.

The code, available at works fine locally. This has lead me to believe the problem lies with nginx.

My website is hosted on a VPS from Vultr running Debian 11. It has ports 80 and 443 open.

My PC is running Manjaro and I'm using rsync to send the files to the VPS.

When running ls -l on the server, all files including those giving the 404 error return -rw-r--r--.

Below is the part of my nginx config that I believe may be relevant:

server { server_name davisstanko.com ; root /var/www/davisstanko/ ; index index.html index.htm index.nginx-debian.html ; location / { try_files $uri $uri/ =404 ; autoindex on ; }

Access log:

Error log:

If you need me to post more information please let me know.

7

1 Answer

Although running ls -l on the server returned -rw-r-r-- for all files including those giving the 404 error the directories themselves did not have the proper permissions. Changing the directories permissions to allow the web server to display these files fixed it.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy