<div>Hello,</div><div><br></div><div>In my server block, I configured a custom 404 error page and I tried to disable access log for /favicon.ico</div><div><br></div><div>error_page 404 /404.html;</div><div>location = /favicon.ico {</div>
<div> access_log off;</div><div>}</div><div><br></div><a href="http://pastebin.com/39qXWuq2">http://pastebin.com/39qXWuq2</a><div><br></div><div>It seems that both conflicts.</div><div><br></div><div>When favicon.ico is present:</div>
<div>curl -I <a href="http://mydomain.com/favicon.ico">http://mydomain.com/favicon.ico</a> reports 200 status code and nothing gets logged into my access log</div><div><br></div><div>When favicon.ico is missing:</div><div>
curl -I <a href="http://mydomain.com/favicon.ico">http://mydomain.com/favicon.ico</a> reports 404 status code</div><div>curl <a href="http://mydomain.com/favicon.ico">http://mydomain.com/favicon.ico</a> displays my custom 404 html page</div>
<div>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"</div>
<div><br></div><div>When I comment out #error_page 404 /404.html; when favicon.ico is missing:</div><div>curl -I <a href="http://mydomain.com/favicon.ico">http://mydomain.com/favicon.ico</a> reports 404 status code</div>
<div>
curl <a href="http://mydomain.com/favicon.ico">http://mydomain.com/favicon.ico</a> displays nginx's default 404 page</div><div>nothing gets logged into my access log</div><div><br></div><div>Can someone explain me this behavior?</div>
<div><br></div><div>Thank you,</div><div>G.</div>