favicon.ico with Nginx

ท่าานเจอกับปัญหา nginx error log โชว์แต่ error ว่าไม่พบ favicon.ico ใช่หรือไม่?

2013/03/27 14:48:45 [error] 7924#0: *2436 open() “/home/nginx/activity.xxx.com/htdocs/favicon.ico” failed (2: No such file or directory), client: 119.44.16.42, server: activity.xxx.com, request: “GET /favicon.ico HTTP/1.1”, host: “praew.xxx.com”
2013/03/27 14:48:48 [error] 7924#0: *2436 open() “/home/nginx/activity.xxx.com/htdocs/favicon.ico” failed (2: No such file or directory), client: 119.44.16.42, server: activity.xxx.com, request: “GET /favicon.ico HTTP/1.1”, host: “praew.xxx.com”
2013/03/27 14:48:50 [error] 7924#0: *2436 open() “/home/nginx/activity.xxx.com/htdocs/favicon.ico” failed (2: No such file or directory), client: 119.44.16.42, server: activity.xxx.com, request: “GET /favicon.ico HTTP/1.1”, host: “praew.xxx.com”

ทางแก้คือ.. บอกให้ nginx ส่งค่า 204 ไปยัง browser ครับ

nginx.conf

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