编辑nginx.conf
- 在server里面增加下列内容:
location /cloud {
location ~* .*.(txt|sh|py){
add_header Content-Type text/plain;
}
alias /home/cloud/;
auth_basic "Enter your name and password";
auth_basic_user_file /usr/share/nginx/mypasswd;
charset utf-8,gbk;
autoindex on;
autoindex_format html;
autoindex_exact_size off;
autoindex_localtime on;
}