Nginx and favicon.ico - “GET /favicon.ico HTTP/1.1” FAILED

喜欢而已 提交于 2021-02-06 14:20:57

问题


How to I get rid of all the below errors in nginx. I do not have a 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"  

I would imagine some line in nginx conf?


回答1:


location = /favicon.ico {
  log_not_found off;
}



回答2:


The best solution for me is:

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


来源:https://stackoverflow.com/questions/9657065/nginx-and-favicon-ico-get-favicon-ico-http-1-1-failed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!