背景:网络那边的人不知道为啥,老是 ipv6那个负载ip访问量特别大,这样搞得我们日志筛选公网ip那,永远排第一的都是内网的这个ipv6负载ip,当然已经是在其他的ipv4已经开了透传的情况下,现在要想办法吧 ipv6 这个负载ip 10.104.120.245 给搞走,别记进日志,话不多说,直接上配置了
其实前面部分都一样,也就 access_log 那加工了一下,具体ip 自己加好了,反正我这配了,120.245 246 这些垃圾ip没记进来了
http {
include mime.types;
default_type application/octet-stream;
log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘
‘request_time “$request_time”‘;
#access_log logs/access.log main;
### 120段的ip不记录进日志了
map $remote_addr $loggable {
default 1;
10.104.120.245 0;
10.104.120.246 0;
}
access_log logs/access.log main if=$loggable;
########################
服务器租用托管,机房租用托管,主机租用托管,https://www.e1idc.com