文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>配置nginx身份验证(ngx_http_auth_basic_module)

配置nginx身份验证(ngx_http_auth_basic_module)

时间:2010-12-14  来源:s3

./configure --with-pcre=../pcre --with-zlib=../zlib --with-http_ssl_module --with-openssl=../openssl --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_flv_module --with-debug

 

修改配置文件

location / {
            root   /usr/local/nginx/html;
                auth_basic "Auth";
                 auth_basic_user_file /usr/local/nginx/conf/htpasswd; 
            index  index.html index.htm;
}

 

auth_basic "Auth"中的Auth是弹出框(输入用户名和密码)的标题

auth_basic_user_file /usr/local/nginx/conf/htpasswd; 中的/usr/local/nginx/conf/htpasswd是保存密码的文件

密码文件生成,需要apt-get install

htpasswd -c /usr/local/nginx/conf/htpasswd 用户名

 

配置好后,重启,应该就可以了。

注:我在配置的时候,由于IE9缓存数据,造成不弹出身份验证框。清楚缓存就好了。

 

 

 

 

 

相关阅读 更多 +
排行榜 更多 +
方块枪战战场安卓版

方块枪战战场安卓版

飞行射击 下载
战斗火力射击安卓版

战斗火力射击安卓版

飞行射击 下载
空中防御战安卓版

空中防御战安卓版

飞行射击 下载