Report this

What is the reason for this report?

403 Error after Initial Server Setup and Nginx Implementation

Posted on January 21, 2020

My website ‘alexanderhorvath.com’ 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 check-host.net

I followed this Medium guide for implementing Nginx : https://medium.com/@jgefroh/a-guide-to-using-nginx-for-static-websites-d96a9d034940

More details can be provided, just let me know



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 @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 - https://www.digitalocean.com/community/tutorials/understanding-the-nginx-configuration-file-structure-and-configuration-contexts

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.

Regards, KDSys

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.