zl程序教程

您现在的位置是:首页 >  工具

当前栏目

nginx—auth身份验证

Nginx auth 身份验证
2023-09-27 14:25:42 时间
server{
    listen 80;
    server_name    localhost;
    location / {
        auth_basic    "Test Basic";
        auth_basic_user_file    conf/htpasswd; #存放密码的文件地址
    }
}

密码存放在文件中,并且是加密的,可以用如下命令生成:

printf "testuser:$(openssl passwd -l Pass123\n)" >> ./htpasswd