When favicon.ico is present:
curl -I http://mydomain.com/favicon.ico reports 200 status code and
nothing
gets logged into my access log
When favicon.ico is missing:
curl -I http://mydomain.com/favicon.ico reports 404 status code
curl http://mydomain.com/favicon.ico displays my custom 404 html page
and strangely the 404 error gets logged into my access log: “HEAD
/favicon.ico HTTP/1.1” 404 0 “-” “curl/7.19.7
(universal-apple-darwin10.0)
libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3”
When I comment out #error_page 404 /404.html; when favicon.ico is
missing:
curl -I http://mydomain.com/favicon.ico reports 404 status code
curl http://mydomain.com/favicon.ico displays nginx’s default 404 page
nothing gets logged into my access log
On Sun, Feb 26, 2012 at 08:43:07PM +0100, Grégory Pakosz wrote:
error_page 404 /404.html; VS access_log off; - Pastebin.com
and strangely the 404 error gets logged into my access log: “HEAD
/favicon.ico HTTP/1.1” 404 0 “-” “curl/7.19.7 (universal-apple-darwin10.0)
libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3”
When I comment out #error_page 404 /404.html; when favicon.ico is missing:
curl -I http://mydomain.com/favicon.ico reports 404 status code
curl http://mydomain.com/favicon.ico displays nginx’s default 404 page
nothing gets logged into my access log
Can someone explain me this behavior?
Requests are logged in a context of a location where processing ends.
That is, if you have 404 error_page configured requests to a
missing favicon.ico file are internally redirected to /404.html,
and handled in an appropriate location, not in location =
/favicon.ico where you have access_log switched off.
Requests are logged in a context of a location where processing ends.
That is, if you have 404 error_page configured requests to a
missing favicon.ico file are internally redirected to /404.html,
and handled in an appropriate location, not in location =
/favicon.ico where you have access_log switched off.
You may want to use the following to minimize the overhead
caused by useless requests for the missing favicon.ico file: