The final solution of 403 Forbidden appeared in Nginx
Nginx appears 403 Forbidden final solution
Step 1:
Check directory permissions. If you don't have enough authority, add a right.
Example: chmod-R 755 / var/www
Step 2:
Open nginx.conf
Example: vim / etc/nginx/nginx.conf
Just change the user user name to user root or other highly privileged user name.
Step three
If it's centos, see if selinux is closed.
View SELinux status:
1. / usr/sbin/sestatus-v # # if SELinux status parameter is enabled, it is enabled.
SELinux status: enabled
2. Getenforce # # can also use this command to check
Turn off SELinux:
1. Temporarily shut down (no need to restart the machine):
Setenforce 0 # # set SELinux to permissive mode
# # setenforce 1 sets SELinux to enforcing mode
2. To modify the configuration file, you need to restart the machine:
Modify / etc/selinux/config file
Change SELINUX=enforcing to SELINUX=disabled
Just restart the machine.
Summary
The above is the final solution of Nginx 403 Forbidden introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!