Nginx Turn off Favicon.ico, robots.txt logging configuration _nginx

Source: Internet
Author: User

Nginx Log recently a large number of access Favicon.ico unable to find 404 error log, small weave feel very affected server performance, for a high concurrent server each error will affect performance, so need to turn off access to the Favicon.ico logging function.

Copy Code code as follows:

# put the following configuration into the server {} block.

Logging when #关闭favicon. ico does not exist
Location =/favicon.ico {
Log_not_found off;
Access_log off;
}

Location =/robots.txt {
Allow all;
Log_not_found off;
Access_log off;
}

# do not allow access to hidden files such as. 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.