当前位置:首页 > 服务器技术 > nginx

nginx限制IP访问网站

需求:网站只允许指定IP访问,其他访问一律拒绝
server
{
listen 80;
server_name a.com;
index index.html index.htm index.php;
root /var/wwwroot/aaa/;
allow 23.100.1.222;
allow 23.107.17.58;
allow 23.107.17.59;
allow 23.107.17.60;
allow 23.107.17.61;
allow 23.107.17.62;
deny all;

原文:https://www.cnblogs.com/leon2659/p/9815686.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!