一、服务器全局限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;}
fastcgi_pass 127.0.0.19000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME varwwwhtdocs$fastcgi_script_name;
include fastcgi_params;
}
}
站点IP限目录
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载