Need to exclude file from server logs

Igor Sysoev igor at sysoev.ru
Tue Feb 22 23:06:17 MSK 2011


On Tue, Feb 22, 2011 at 12:37:11PM -0300, Flavio Torres wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 02/22/2011 12:26 PM, bindsocket wrote:
> > Dont know if this is even possible but I have a healthcheck file
> > that is checked by a load balancer every 30 seconds. However, I
> > really do not want the webserver to be logging this. Is there some
> > way to configure the server to ignore a file or directory as far as
> > the logging is concerned??
> >
> > Running nginx 0.7.65 on Ubuntu 10.04
> >
> 
> 
> I don't know if it's the best way to configure a healthcheck, but:
> 
>         location = /healthcheck_nginx.html {
>                 access_log   off;
>                 root /usr/share/nginx/html;
>                 index healthcheck_nginx.html;
>         }
> 
> 
> hope this helps.

"index healthcheck_nginx.html" is useless here: it's required for
requests with trailing slash, but this location works only for
"/healthcheck_nginx.html".

Also "root" probably can be inherited from server level.


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list