Welcome 微信登录

首页 / 操作系统 / Linux / Nginx 访问目录身份验证

假设/www/htdocs/ 为服务器根目录,新建test目录,当访问test目录时 需要身份验证1. # cd /etc/nginx/conf/htpassword2. /usr/bin/htpasswd -c /usr/local/nginx/conf/htpasswd/test auth_user3. # vi /etc/nginx/nginx.conf     server{***#test
        location /test {
                auth_basic "Restricted";
                auth_basic_user_file  /usr/local/nginx/conf/htpasswd/test;
        }****     }现在如果继续访问test/目录下的内容,就需要身份验证,输入 auth_user 和 密码就可以访问Linux作业关闭与激活Ubuntu源码安装Insight调试器相关资讯      Nginx 
  • Nginx和Nginx+的比较  (01月02日)
  • 使用 Ansible 安装 NGINX 和 NGINX  (10/08/2015 13:01:17)
  • 如何使用 Datadog 监控 Nginx(第  (08/25/2015 14:00:05)
  • 你应该了解Nginx的7个原因  (11/09/2015 11:20:48)
  • Nginx-1.9.5 开发版已发布下载,支  (09/23/2015 07:35:56)
  • NGINX 初期 Alpha 版 HTTP/2 模块   (08/15/2015 19:43:22)
本文评论 查看全部评论 (0)
表情: 姓名: 字数