Nginx和favicon.ico - “GET /favicon.ico HTTP / 1.1”失败

时间:2012-03-11 17:17:11

标签: nginx

如何摆脱nginx中的所有以下错误。我没有favicon.ico

2012/03/11 17:13:25 [error] 959#0: *116 open() "/usr/local/nginx/html/favicon.ico" failed (2: No such file or directory), client: 111.68.59.75, server: 127.0.0.1, request: "GET /favicon.ico HTTP/1.1"  

我会想象nginx conf中的某些行吗?

2 个答案:

答案 0 :(得分:52)

location = /favicon.ico {
  log_not_found off;
}

答案 1 :(得分:14)

对我来说最好的解决方案是:

location = /favicon.ico {
  return 204;
  access_log     off;
  log_not_found  off;
}