Developers, Developers, Developers! Maksim Sorokin IT Blog


Handling Noisy favicon.ico Messages in Nginx

Modern browsers usually asks for favicon icon of the website. Therefore you may something like following in nginx error.log and access.log:
2010/12/14 13:28:30 [error] 3036#3048: *2 CreateFile() "e:/p2/favicon.ico" failed (2: The system cannot find the file specified), client:, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "myhost"
or - - [14/Dec/2010:13:28:30 +0100] "GET /favicon.ico HTTP/1.1" 404 571 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10"

Nice way to handle that is to put the following into nginx.conf:

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

Taken from here and here.

Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.