只允许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;
}
只允许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;
}
本文链接:https://www.kinber.cn/post/1825.html 转载需授权!
推荐本站淘宝优惠价购买喜欢的宝贝: