nginx 驗證

生成密碼文件
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;
        }




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章