只允许1.2.3.4这个IP访问我们的站点,拒绝所有其他IP的访问。
server {
listen 80;
server_name www.example.com;
satisfy any;
allow 1.2.3.4;
deny all;
auth_basic "INPUT YOUR USERNAME:";
auth_basic_user_file /usr/local/nginx/conf/passwd;
}