[Linux] Nginx Networking 403 Forbidden static files are not allowed to view

Source: Internet
Author: User

Http://www.cnblogs.com/abeen/p/4517171.html

Nginx's 403 Forbidden errors indicates that you are requesting a resource file but Nginx does not allow you to view it.

403 Forbidden is just an HTTP status code, like 404,200 is not a technical error.
Which scenes need to return a 403 status code scenario.

1. The website prohibits specific users from accessing all content, for example: the site masks an IP access.
2. Access directory to prohibit directory browsing, example: Set AutoIndex off to access the directory.
3. User access to only intranet access files.

1. Permissions are not configured correctly

Workaround: Set all parent directories to 755 permissions and set the file to 644 permissions to avoid incorrect permissions.

Or: Modify nginx.conf file modification nginx start user.

Or: Modify Www-data Read and write permissions to the corresponding directory.


2. Directory index Setup error (index directive configuration)

The web site root does not contain a file that is set by the index directive.

Solution: Add the first file to the index directive, common is index.php,index.jsp,index.jsp or custom first page file.

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.