Avoid logging specific user agents requests

B.R. reallfqq-nginx at yahoo.fr
Sat Apr 11 13:18:46 UTC 2015


I tend to use official documentation only, and I run servers, not Windows.

However, thanks for the pointer: the answer might be that 'if' parameter...
However not available in the stable branch yet.
I will see to it. Thanks again!
---
*B. R.*

On Sat, Apr 11, 2015 at 2:10 PM, itpp2012 <nginx-forum at nginx.us> wrote:

> Page 18 from nginx for Windows - documentation 1.3;
>
> map $request_uri $loggablevhts {
> default      1;
> /ngxvtstatus      0; # zero=do not log
> /vtsvalues.js      0; # zero=do not log
> /vtsvalues-eop.js      0; # zero=do not log
> /ngxvtstatus/format/json    0; # zero=do not log
> }
> map $remote_addr $lcladdrvhts {
> default      1;
> ~^(127.0.0.*)$      0; # zero=do not log
> }
>
> # don't log vhts entries when request is local or from management interface
> map $loggablevhts$lcladdrvhts $loggable {
> default      0;
> ~1      1;
> }
>
> access_log   /path/to/access.log  combined  if=$loggable;
>
> “A request will not be logged if the (IF) condition evaluates to "0" or an
> empty string”
>
> Two simple ‘maps’ which are then combined tested in the third ‘map’ which
> is
> used in the
> IF evaluation of the log directive.
>
> Tweak, change, add your own stuff with $request
>
> See also nginx-simple-WAF.conf in the nginx for Windows release archives.
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,257961,257964#msg-257964
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150411/e2d64951/attachment.html>


More information about the nginx mailing list