January 22, 2013 10:36PM
You can try ngx_log_if module

https://github.com/cfsego/ngx_log_if


-----邮件原件-----
发件人: nginx-bounces@nginx.org [mailto:nginx-bounces@nginx.org] 代表 Mik J
发送时间: 2013年1月18日 16:01
收件人: nginx@nginx.org
主题: Re: Not logging access to favicon.ico



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

> De : Jonathan Matthews <contact@jpluscplusm.com>
>
> On 17 January 2013 22:53, Agus <agus.262@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


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

________________________________

This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you.

本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Not logging access to favicon.ico

miky January 17, 2013 04:38PM

Re: Not logging access to favicon.ico

Agus January 17, 2013 05:54PM

Re: Not logging access to favicon.ico

Jonathan Matthews January 17, 2013 06:24PM

Re: Not logging access to favicon.ico

miky January 18, 2013 03:02AM

Re: Not logging access to favicon.ico

Mark Alan January 18, 2013 06:10AM

答复: Not logging access to favicon.ico

cfsego January 22, 2013 10:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready