A strange common problem: nginx 403 forbidden error, nginxforbidden

Source: Internet
Author: User
Tags 403 forbidden error

A strange common problem: nginx 403 forbidden error, nginxforbidden

Install dedecms today, configure Nginx, generate a one-click static page, and then no more. nginx 403 forbidden is displayed on all the column pages.

Generally, nginx 403 Forbidden errors indicates that you are requesting a resource file, but nginx does not allow you to view it.
403 Forbidden is only an HTTP status code. Like 404,200, it is not a technical error.
Which scenarios require 403 status codes to be returned?
1. The website prohibits a specific user from accessing all content. For example, the website shields access from a certain ip address.
2. Access the directory where directory browsing is prohibited. For example, access the directory after autoindex is off.
3. Users can only access files through the Intranet.
The preceding common scenarios require 403 Forbidden.

1. Incorrect permission Configuration

No. Check the nginx. conf header and use nginx. Many people on the Internet say that changing to root is also drunk. In fact, the column directory is readable for nginx users, which is not a problem at all.

Ii. Incorrect Directory index settings (index Command configuration)

Since dedecms is a PHP program, you didn't pay attention to the configuration below.
Index. php;
Then the tragedy happened, and there was no PHP file in the column, but index.html.
When you access this website, nginx searches for files in the root directory in the order of index. php (one in this case. If the file does not exist (apparently not exist), nginx returns 403 Forbidden.

Configure it to index index.html index.htm index. php;

Then restart nginx-s relaod.

Related Article

Contact Us

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.