avatar
童琦杰
向死而生
githubmusic
2022-01-04编辑

Nginx设置IP白名单

修改配置文件

/etc/nginx/sites-enabled/example.conf
nginx
http {
   ...
   allow xx.xx.xx.xx;
   allow xx.xx.xx.xx;
   deny all;
   ...
}

server {
    ...
    allow xx.xx.xx.xx;
    allow xx.xx.xx.xx;
    deny all;
    ...
}

location / {
   allow xx.xx.xx.xx;
   allow xx.xx.xx.xx;
   deny all;
}

加载Nginx配置

bash
nginx -s reload