40

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?

Tampa
  • 69,424
  • 111
  • 266
  • 409

2 Answers2

68
location = /favicon.ico {
  log_not_found off;
}
palerdot
  • 6,938
  • 5
  • 41
  • 46
Alexander Azarov
  • 12,607
  • 2
  • 47
  • 52
  • 4
    One should mention that this is a nginx setting. ``Edit the file /etc/nginx/sites-available/owncloud.conf`` (or similar) and add this. Then restart ``nginx`` OC community seems to discuss this topic as well. – Powerriegel Feb 04 '16 at 19:36
  • I'm using Elastic Beanstalk to run a Ruby on Rails application. I don't see any `/etc` folder, but i still get regular `/favicon.ico` not found errors. Where can i set a similar configuration for Elastic Beanstalk? – Jeremy Moritz Feb 25 '19 at 13:20
  • @JeremyMoritz I am not familiar with AWS EB setup, but maybe this is what you are searching for? -- https://stackoverflow.com/questions/23709841/how-to-change-nginx-config-in-amazon-elastic-beanstalk-running-a-docker-instance – Alexander Azarov Feb 25 '19 at 18:33
31

The best solution for me is:

location = /favicon.ico {
  return 204;
  access_log     off;
  log_not_found  off;
}
Pavel Prischepa
  • 807
  • 1
  • 9
  • 18