直接举例
nginx主要涉及配置
server {
listen 80 ;
listen 443 ssl;
server_name ssl-public-test.com ;
location /common_tool_ts/{
auth_basic "Please input password";
auth_basic_user_file /data/app/nginx/sbin/pwd;
.....
......
}
接下来是openssl设置的密码
printf "dianhun:$(openssl passwd -crypt dianhunos)\n" >pwd
Warning: truncating password to 8 characters
cat pwd
dianhun:fHvrEynCIVhtk
最后是效果