Nginx disable favicon.icow.robots.txt Logging

Source: Internet
Author: User

If you want to close the log records of favicon.icow.robots.txt in nginx, you are not allowed to access some hidden files.

In fact, there is a favicon. ico that is quite good. When a webpage is placed on the taskbar, You can differentiate your own website and enjoy a good user experience.

In addition, the robots.txt file is ready for use, which is helpful for blocking malicious inclusion.

Nginx logs have recently accessed favicon. 404 error logs that ico cannot find affect the server performance. For a high-concurrency server, every error affects the performance. Therefore, you need to disable access to favicon. ico logging function.

Operation Method:

# Place the following configuration in the server {} block. # disable favicon. log location =/favicon when ico does not exist. ico {log_not_found off; access_log off;} www. jbxue. comlocation =/robots.txt {allow all; log_not_found off; access_log off;} # hidden files cannot be accessed, for example. htaccess ,. htpasswd ,. DS_Store (Mac ). location ~ /\. {Deny all; access_log off; log_not_found off ;}

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.