知识屋:更实用的电脑技术知识网站
所在位置:首页 > 操作系统 > linux

nginx验证

发布时间:2014-09-05 17:05:36作者:知识屋

生成密码文件

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;

        }

(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜