Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Due to development needs, in the local environment to configure the Nginx environment, using the installation of the CentOS 6.5 yum, install all normal, so the website files with the MV command moved to the new directory, and modify the configuration file, and restart Nginx.
Restart on a "403 is forbidden" error, view/var/log/nginx/error.log log display: XXX 403 Forbidden (13:permission denied) error.
Cause Nginx 403 Forbidden is usually three cases: one is the missing index file, the second is the permission problem, and the third is the SELinux state.
The missing index.html or index.php file is the specified file in the configuration file in the index index.html index.htm this line.
Index index.php index.html;
If there is no index.php,index.html under/var/www, direct access to the domain name, cannot find the file, will be reported 403 forbidden.
Second, permissions issues, if Nginx does not have the Web directory operation permissions, there will also be a 403 error.
Workaround: Modify the Web directory read and write permissions, or to the user to change the Nginx startup user directory, restart Nginx can be resolved
To change the Nginx startup user to the directory's user-owned method:
Third, the reason that SELinux is set to On state (enabled)
Check the on state of the native SELinux first, if the SELinux status parameter is enabled
or use the Getenforce command to check
Find out why, how to close SELinux?
1. Temporary shutdown (no restart)
2, modify the configuration file/etc/selinux/config, change selinux=enforcing to Selinux=disabled
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.