location /admin/
{
allow 192.168.133.1; #允许访问的ip地址
allow 127.0.0.1; #允许访问的ip地址
deny all;
}
mkdir /data/wwwroot/test.com/admin/
echo “test,test”>/data/wwwroot/test.com/admin/1.html
-t && -s reload
curl -x127.0.0.1:80 test.com/admin/1.html -I
curl -x192.168.133.130:80 test.com/admin/1.html -I
原文:http://blog.51cto.com/13451715/2324061