Low Orbit Flux Logo 2 F

NGINX - 403 forbidden

You may encounter the error, “403 forbidden” when accessing certain pages on your NGINX server. This usually just indicates that you don’t have permission to access that page.

For example, you might try to access the following page:

http://192.168.3.22/test.html

We can check the file on the server like this.


ls -l /var/www/html/test.html

If the permissions look like this for example:


--w------- 1 root root 5 Nov 28 16:42 /var/www/html/test.html

It means that no user has access to read the file, including the web server.

We can fix that by granting read access like this:


sudo chmod a+r /var/www/html/test.html

This will result in the permissions looking more like this:


-rw-r--r-- 1 root root 5 Nov 28 16:42 /var/www/html/test.html

The page should now work.