"GET /favicon.ico HTTP/1.1" 404

centos7.5 没有ico图标,日志中报错

问题:

[root@lb01 conf.d]# tail -f /var/log/nginx/access.log 
10.0.0.1 - - [06/May/2019:20:21:46 +0800] "GET /favicon.ico HTTP/1.1" 404 555 "http://web.lvhanzhi.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36" "-"

原因:没有ico图标,所以在日志中报错404

解决方法:

方法一:项目里面放入ico图标

方法二:直接返回200,不去文件中查找

[root@lb01 conf.d]# vim web.lvhanzhi.com.conf 
server{
	listen 80;
	server_name web.lvhanzhi.com;
	location / {
			proxy_pass http://10.0.0.7:80;
			proxy_set_header Host $http_host;
			proxy_http_version 1.1;
	}
	location /favicon.ico{
		return 200;
		access_log off;
	}
}
posted @ 2019-05-06 20:33  吕涵之  阅读(15293)  评论(0编辑  收藏  举报