需求:网站只允许指定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;
nginx限制IP访问网站
原文地址:https://www.cnblogs.com/leon2659/p/9815686.html