生成密碼文件
<="" body="">
htpasswd -b -c 文件名 用戶名 密碼
編輯nginx.conf
server {
listen 80;
server_name localhost;
auth_basic "input you user name and password";
auth_basic_user_file /usr/local/nginx/conf/nginx_passwd;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /var/www/html;
index index.html index.htm;
}
location /soft{
autoindex on;
autoindex_exact_size off;
root /var/www/html;
}