nginx.conf

最后加上 include deny.ip

vim deny.ip

deny 192.168.0.102;          ###禁止此IP

deny 192.168.0.0/24;   ###禁止192.168.0.0-192.168.0.255

deny 192.168.0.0/16;   ###禁止192.168.0.0-192.168.255.255

deny 192.0.0.0/8;      ####从192.0.0.0到192.255.255.254