MediumDigitalOcean 403 Forbidden NGINX Error | by Arjun N | Medium
Sitemap
Arjun N

Arjun N

DIGITAL MARKETING SPECIALIST | SEO EXPERT @skynats (SERVER MANAGEMENT COMPANY)

DigitalOcean 403 Forbidden NGINX Error

2 min readMar 29, 2022

How to fix Digitalocean 403 forbidden nginx error?

When a client attempts to access a part of the webserver with insufficient permissions, the Nginx 403 Forbidden error is generated and displayed to the user.

Let’s take a look at the ways our Technical Support team took to fix it:

systemctl status nginx

You must see something like this if nginx is up and running:

nginx.service - The nginx HTTP Server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2019-11-19 09:37:46 UTC; 2 days ago Docs: https://httpd.nginx.org/docs/2.4/

If nginx is not running, the output will be as follows:

nginx.service - The nginx HTTP Server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: inactive (dead) since Fri 2019-11-22 08:41:01 UTC; 39s ago Docs: https://httpd.nginx.org/docs/2.4/systemctl start nginx

Then double-check the status to ensure that nginx is still running.

systemctl enable nginx

Check your nginx config syntax:

Get Arjun N’s stories in your inbox

Join Medium for free to get updates from this writer.

If you receive an error, you must first resolve the issue before restarting nginx:

systemctl restart nginxtail -f /var/log/nginx/error.log

Consider the user which your nginx service is running as:

ps auxf | grep nginx

If you’re using Ubuntu, the user you must be www-data, so ensure that your files and folders are purchased by that user so that nginx can read and write to them:

chown -R www-data:www-data /var/www/yourdomain.comnetstat -plant | grep '80\|443'

Other troubles with the server:

Error 403: Client-Side Cause

As previously stated, the 403 error can also be caused by the user rather than the server. Undertake the basic operations on the client side to fix such problems.

Are you looking for an answer to another query? Contact our technical support team.

Originally published at https://www.skynats.com on March 29, 2022.

--

--

Arjun N
Arjun N

Written by Arjun N

DIGITAL MARKETING SPECIALIST | SEO EXPERT @skynats (SERVER MANAGEMENT COMPANY)