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 ;}