Hi,
So the conditional logging example on nginx website is this, which I've tried, and it works as advertised.
-----------
map $status $loggable {
~^[23] 0;
default 1;
}
access_log /path/to/access.log combined if=$loggable;[/quote]
-----------
What happens if I also want to stop logging for clients with the User Agent "Zabbix"? If I try this ...
-----------------
map $status $loggable {
~^[23] 0;
default 1;
}
map $http_user_agent $loggable {
Zabbix 0;
default 1;
}
access_log /path/to/access.log combined if=$loggable;
---------------
... then the first map is superceded by the second, i.e. the $status is ignored and only the $http_user_agent is used to decide what is logged.
Whats the trick for setting $loggable=0 for both cases?