Question

nginx 403 error

I have been wrestling with this on my droplet and cannot see why I keep getting this error and the error in the /var/log/nginx/error.log below. Any help appreciated.

signupadmin@signup:~$ sudo tail -f /var/log/nginx/error.log [sudo] password for signupadmin: 2024/01/06 12:46:35 [error] 2334#2334: *101 “/home/signupadmin/exhibit_website/ExhibitOnePage/index.html” is forbidden (13: Permission denied), client: 87.236.176.204, server: 143.198.116.69, request: “GET / HTTP/1.1”, host: “143.198.116.69”

2024/01/06 12:50:06 [error] 2334#2334: *102 “/home/signupadmin/exhibit_website/ExhibitOnePage/index.html” is forbidden (13: Permission denied), client: 192.241.199.83, server: 143.198.116.69, request: “GET / HTTP/1.1”, host: “143.198.116.69”

2024/01/06 13:02:06 [error] 2334#2334: *103 open() “/home/signupadmin/exhibit_website/ExhibitOnePage/.env” failed (13: Permission denied), client: 57.129.23.166, server: 143.198.116.69, request: “GET /.env HTTP/1.1”, host: “143.198.116.69”

2024/01/06 13:02:06 [error] 2334#2334: *104 “/home/signupadmin/exhibit_website/ExhibitOnePage/index.html” is forbidden (13: Permission denied), client: 57.129.23.166, server: 143.198.116.69, request: “POST / HTTP/1.1”, host: “143.198.116.69”

2024/01/06 13:04:19 [error] 2334#2334: *105 “/home/signupadmin/exhibit_website/ExhibitOnePage/index.html” is forbidden (13: Permission denied), client: 185.134.22.149, server: 143.198.116.69, request: “GET / HTTP/1.1”, host: “143.198.116.69”

2024/01/06 13:04:20 [error] 2334#2334: *106 open() “/home/signupadmin/exhibit_website/ExhibitOnePage/systembc/password.php” failed (13: Permission denied), client: 185.134.22.149, server: 143.198.116.69, request: “GET /systembc/password.php HTTP/1.1”, host: “143.198.116.69”

2024/01/06 13:04:21 [error] 2334#2334: *107 open() “/home/signupadmin/exhibit_website/ExhibitOnePage/Ep1v” failed (13: Permission denied), client: 185.134.22.149, server: 143.198.116.69, request: “GET /Ep1v HTTP/1.1”, host: “143.198.116.69”

2024/01/06 13:04:23 [error] 2334#2334: *108 open() “/home/signupadmin/exhibit_website/ExhibitOnePage/GWqN” failed (13: Permission denied), client: 185.134.22.149, server: 143.198.116.69, request: “GET /GWqN HTTP/1.1”, host: “143.198.116.69”

2024/01/06 13:05:47 [error] 2334#2334: *110 “/home/signupadmin/exhibit_website/ExhibitOnePage/index.html” is forbidden (13: Permission denied), client: 97.147.10.55, server: 143.198.116.69, request: “GET / HTTP/1.1”, host: “143.198.116.69”

2024/01/06 13:05:48 [error] 2334#2334: *110 open() “/home/signupadmin/exhibit_website/ExhibitOnePage/favicon.ico” failed (13: Permission denied), client: 97.147.10.55, server: 143.198.116.69, request: “GET /favicon.ico HTTP/1.1”, host: “143.198.116.69”, referrer: “http://143.198.116.69/


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
January 6, 2024

Heya @andrewchalk,

The error messages you’re seeing in your NGINX error log are related to permission issues on your server. Specifically, NGINX does not have the necessary permissions to access the files in your specified directory (/home/signupadmin/exhibit_website/ExhibitOnePage). This is indicated by the error message “Permission denied”. Here are steps to troubleshoot and potentially resolve this issue:

  1. Check File Permissions: Ensure that the files and directories NGINX is trying to access have the correct permissions. NGINIX usually runs as the www-data user or similar, so this user needs to have read access to the files.
sudo ls -l /home/signupadmin/exhibit_website/ExhibitOnePage

This command will show the permissions of the files. You’re looking for something like -rw-r--r-- for files and drwxr-xr-x for directories.

  1. Change Ownership or Permissions: If the permissions are incorrect, you can change them. You can either change the ownership of the files to the NGINX user (usually www-data or similar) or adjust the permissions so that other users can read the files.

    To change ownership:

sudo chown -R www-data:www-data /home/signupadmin/exhibit_website/ExhibitOnePage

To change permissions:

sudo chmod -R 755 /home/signupadmin/exhibit_website/ExhibitOnePage
  1. Check SELinux Contexts: If you’re running a system with SELinux enabled (like CentOS or RHEL), ensure that the files have the correct SELinux contexts. Use ls -Z to check and chcon or restorecon to adjust contexts.

  2. Check NGINX Configuration: Ensure that your NGINX configuration file is correctly pointing to the right root directory and the server has permission to access it.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel