Home  >  Article  >  Backend Development  >  nginx ignores faviconico logs favicon.ico 404 online favicon favicon 1 htm disease

nginx ignores faviconico logs favicon.ico 404 online favicon favicon 1 htm disease

WBOY
WBOYOriginal
2016-07-29 08:54:151621browse

Note:
favicon.ico takes up a lot of information in the nginx error_log log, covering the logs we really need to view. So here, we turn it off via log_not_found off.
favicon,favicon.ico是什么,favicon.ico下载,favicon图标,favicon.ico图标,favicon.ico尺寸,favicon在线制作,favicon.ico不显示,favicon.ico制作,favicon.ico代码,favicon是什么意思,favicon.ico 在线,favicon.ico 404,在线favicon,favicon 1 htm病
Implementation:
//Put the following configuration into the server {} block, and turn off logging when favicon.ico does not exist

location =/favicon.ico {
log_not_found off;
access_log off;
}
//log_not_found on|off,默认为on:启用或禁用404错误日志,这个指令可以用来禁止nginx记录找不到rebots.txtfavicon.ico这类文件的错误信息。


Appendix:
1. I saw a sentence on the Internet saying: Note that error_log off does not close the log Logging function, it writes the log file to a file named off. If you want to turn off the error logging function, you should use the following configuration: error_log /dev/null crit;
off location is /usr/local/nginx/ off, that is, in the installation directory of nginx

2. Changing log_not_found off to error_log off has the same effect. The difference is that writing error_log off outputs the error log to the off file, while log_not_found closes the log.

Reprinted from: http://coolnull.com/1516.html

The above introduces nginx to ignore the faviconico log, including favicon and iconic content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn