Wordpress website shows: 403 Forbidden on Ubuntu Nginx

Posted September 18, 2020 2.2k views
NginxWordPressUbuntu 18.04

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?


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.

Submit an Answer
1 answer

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 :

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.


by Justin Ellingwood
When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks in Nginx on an Ubuntu 16.04 server.