访问nginx时验证密码

只容许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;

}

相关文章
相关标签/搜索