Not logging access to favicon.ico

Mik J mikydevel at yahoo.fr
Fri Jan 18 08:00:54 UTC 2013



----- Mail original -----

> De : Jonathan Matthews <contact at jpluscplusm.com>
> 
> On 17 January 2013 22:53, Agus <agus.262 at gmail.com> wrote:
>>  location is only available in server block. Though you could create a file
>>  with the location /favicon... and then include it in every server block
>>  which will save you typing.
> ... I use this, and include it in every server{} stanza:
> 
> location /favico {
>   access_log off;
>   error_log /dev/null crit;
>   empty_gif;
> }


Thank you guys, so I'll put a somilar configuration as below for all my virtual hosts:
# cat /etc/nginx/sites-available/default
server {
        listen 80 default_server;
        server_name _;
        index index.html;
        root /var/nginx/html;
        access_log /var/log/nginx/default.access.log;

        location /favico {
        access_log off;
        error_log /dev/null crit;
        empty_gif;
        }
}

I was wondering that since this "location" block (and probably other settings) is going to be repeated in every one of my virtual hosts there would be a was to configure this globally.
I don't have any server stanza since I use include /etc/nginx/sites-enabled/*;
I'll do as Jonathan says except if someone has another suggestion.
Bye




More information about the nginx mailing list