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;

        }

相关内容

    暂无相关文章