当用nginx的时候,可能需要限制登陆
一句话解决
printf "admin:$(openssl passwd -crypt 123456)\n" > .htpasswd
nginx的配置如下:
location /
{
auth_basic "nginx basic http test for ttlsa.com";
auth_basic_user_file /data/html/.htpasswd;
autoindex on;
}