nginx 禁止指定的IP地址访问2

步骤1:添加配置

# 在站点的配置文件中,添加如下的配置
location / {
deny IP地址1;
deny IP地址2;

}

步骤2:重启Nginx服务器