Report this

What is the reason for this report?

Wordpress website shows: 403 Forbidden on Ubuntu Nginx

Posted on September 18, 2020

Hello I have a WordPress website running under Ubuntu 18 and Nginx and I get the following error “403 Forbidden”

When I check the error log I can see these problems pretty much every single time “106 directory index of “/var/www/html/” is forbidden”

How can I solve this problem?

Thanks



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!

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.

Hi @boriszegarac,

Firstly, make sure in your Nginx configuration file for your domain, you have the proper DocumentRoot. If you are uncertain on how it should look, I’ll recommend either posting it here or checking out the following article :

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

The second thing I would ask you to make sure is, given your DocumentRoot, that your website is actually in that directory. If there is no index page, a 403 error like you are experiencing will be shown.

Next thing you might want to check if your ownership and permissions. Usually, the permissions should be 644 for files and 755 for folders. As for the ownership, it should be your Nginx user that you have specified.

Do the above things and see if they work. If they don’t please post a part of your error_log relevant to the issue experienced.

Regards, KFSys

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.