403 Error after Initial Server Setup and Nginx Implementation

Posted January 21, 2020 1.1k views
NginxServer OptimizationInitial Server Setup

My website ‘’ is displaying a '403 Forbidden’ error when searching its address.

I think the problem is with the configuration file (located in root/var/ww)

Or, my private key is inaccessible to to the public

I followed the Digital Ocean guides on initial server setup, haphazardly so, until I found my domain located on

I followed this Medium guide for implementing Nginx :

More details can be provided, just let me know

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 @ajhorvath36,

It seems like your Nginx configuration file is not serving the proper files or it’s not seeing the document root folder. DigitalOcean has a pretty good tutorial on that matter here -

Having said that, here are a few suggestions you might check

Index Files

One of the most common causes of the “403 Forbidden” error is not having a correctly set up index file.

The NGINX configuration file specifies which index files to load, and in which order. For example, this line tells NGINX to look for index.html, then index.htm, then index.php:

index index.html index.htm index.php;mixed

If none of those three files are found in the directory, NGINX returns a “403 Forbidden” error.

File Permissions

Incorrect file permissions are another cause of the “403 Forbidden” error. The standard setting of 755 for directories and 644 for files is recommended for use with NGINX. The NGINX user also needs to be the owner of the files.

Additionally, if you are unable to resolve it, please pass your Nginx Configuration and I’ll be able to further help you out.


by Justin Ellingwood
Nginx is one of the most popular web servers in the world, focused on performance and scalability. In this guide, we will explore the Nginx configuration file structure and discuss the configuration "contexts" that Nginx uses to logically separate different configuration values.