How don';是否在Nginx中记录指定的IP地址?
我在VPS的IP上建立了数千个连接,如下所示:How don';是否在Nginx中记录指定的IP地址?,nginx,debian,ispconfig,Nginx,Debian,Ispconfig,我在VPS的IP上建立了数千个连接,如下所示: 51.15.76.184-[2017年12月17日:16:31:17-0200]“CONNECT portal.geniptv.com:8080http/1.1“400 172”-” 这些连接已经被阻止(HTTP/1.1“400=错误请求),但是/var/log/nginx中的my access.log文件的大小达到了几GB 如何以及在何处停止记录此IP 我有带ISPconfig 3和nginx的Debian 8 提前感谢。access\u log
51.15.76.184-[2017年12月17日:16:31:17-0200]“CONNECT portal.geniptv.com:8080http/1.1“400 172”-”
这些连接已经被阻止(HTTP/1.1“400=错误请求),但是/var/log/nginx中的my access.log文件的大小达到了几GB
如何以及在何处停止记录此IP
我有带ISPconfig 3和nginx的Debian 8
提前感谢。access\u log指令有一个选项,可以根据变量的值不记录请求。映射可用于设置该变量:
map $remote_addr $logging {
default 1;
~^51.15.76.184$ 0;
# ... (if there are more, consider putting them in an included file)
}
server {
access_log /var/log/nginx/example.com.access.log main if=$logging;
# ...
}
非常感谢科尔·蒂尔尼。在你的帮助下,我成功地阻止了。我还禁止使用iptables
iptables-A输入-s 51.15.76.184/32-I eth0-j DROP。