nginx 禁止 IP 访问

新建 blockip.conf

deny 123.123.123.123;   # 拒绝
allow 8.8.8.8;          # 同意
deny 192.168.1.11;      # 网段
deny 192.168.1.123;
deny 10.0.1.0/24;

引入include blockip.conf

重启service nginx restart