[root@2a2d6ffd4d79 nginx]# printf "test:$(openssl passwd 1234567890)" > .passwd # 这样只能生成最长8位的密码
Warning: truncating password to 8 characters
printf "test:$(openssl passwd -5 1234567890123456@Aab)" > .passwd # 这样可以突破8位密码长度
下面可以使静态服务器增加密码验证
location /static {
alias /srv/http/statics;
autoindex on;
auth_basic "DW Center";
auth_basic_user_file /etc/nginx/.passwd;
}