只容許1.2.3.4這個IP訪問咱們的站點,拒絕全部其餘IP的訪問。nginx
server {spa
listen 80;server
server_name www.example.com;file
satisfy any;auth
allow 1.2.3.4;co
deny all;
auth_basic "INPUT YOUR USERNAME:";
auth_basic_user_file /usr/local/nginx/conf/passwd;
}