一、服务器全局限IP #vi nginx.conf allow 10.57.22.172; #允许的IP deny all; 二、站点限IP #vi vhosts.conf 站点全局限IP: location / { index index.html index.htm index.php; allow 10.57.22.172; deny all; location ~ \.php$ { if ( $fastcgi_script_name ~ \..*\/.*php ) {return 403;} fa More