Tag Archives: 403 Forbidden

How to Solve Nginx error: 403 Forbidden

Today, I tested nginx access on my virtual machine, and the results were 403 Forbidden

First check whether there is a missing index in the nginx configuration file HTML or index PHP files, files are normal

Check the SELinux status of the server. The configuration file/etc/SELinux/config and SELinux = disabled are also correct

Then check the log information:/usr/local/nginx/logs/error log

The display is caused by permission problems. View the main configuration file of nginx/usr/local/nginx/conf/nginx conf

After changing the user to root, restart nginx # systemctl restart nginx Service access is effective

Summary: there are three common situations causing nginx access error 403 Forbidden: lack of index file, permission problem and SELinux status

It can be successfully modified according to specific problems.