linux 2020年12月7日

nginx 允许特定省市访问

诸 诸天无道 约 1 分钟 3736 次阅读

查找指定省市IP段

如山东IP段

将全部IP段或者需要的IP段转化为CIDR规则

image.png

修改nginx配置文件

location / {
   #...
   include banips/allow.conf;
}

修改allow.conf

allow 39.64.0.0/11;
deny all;

重启nginx配置生效

#nginx #ban #ip

评论 0

还没有评论,来说两句吧~

发表评论

评论将直接显示
目录