1
akira 2017 年 9 月 23 日 access_log 的 off 只影响本层。试试用 access_log if=condition 格式
map $status $loggable { abcd 0; 123456789 0; default 1; } access_log /var/log/nginx/access.log combined if=$loggable; |
2
keepfun 2017 年 9 月 23 日 via iPhone
有个 nginx_log 插件,可以实现
|
3
lerry 2017 年 9 月 23 日
location / {
if ($http_user_agent ~* (Chrome\/50\.0\.2661\.102|MSIE\ 9\.0) ) { access_log off; return 403; } } 我这样写是好使的,注意转义 |
4
ayiis 2017 年 9 月 23 日
放在 location 里是没问题的,可能是正则没写好?
|