avatar
童琦杰
Jan 4, 2022Technology

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
© 2015-2022 tongqijie.com 版权所有沪ICP备17000682号