*3 access forbidden by rule nginx

  • Posted October 23, 2021
  • Nginx

I have configured a server to run on the domain

This is using a LEMP droplet.

The homepage loads correctly, however all of the subpages give the error

access forbidden by rule nginx

This is a Laravel app, I have tested that php8.0-fpm is running. nginx all seems fine too.

Can anyone help guide in where best to find this alusive rule.

Thanks in advance


Submit an 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 there,

What this error means is that the request is dropped by the rules in the configuration file.

What I would recommend you do is you check the rules you specified in the configuration file. Maybe if you check for rules which start with Allow or Deny?

You can also check if you have added the index files after your root path in your server block. In order to do that first go to etc/nginx/sites-enabled, and then add the index files you wish to load after the root path. It should look something like this:

root /var/www/site;

index index.php index.html index.hml;

I hope that this helps and please let me know how it goes.

Regards, Boyan