Nginx http_auth_basic_module(访问控制功能)

ngx_http_auth_basic_module模块
实现基于用户的访问控制,使用basic机制进行用户验证

用户登陆认证的模块

syntax:   auth_basic string | off;
default:   auth_basic off
context:   server.loction.limit_except
进行配置用户相关的登陆设置

sytax:  auth_basic_user_file file;
default:  -
context:  server,location,limit_except

进行对上述的引入

用户口令文件
1、铭文文本:格式name:password:comment
2、加密文本:由passwd命令实现
http-tools提供

扫描二维码关注公众号,回复: 7993570 查看本文章

创建一个http-tools
pw:123456

 

第二次创建不需要加-c参数

修改配置文件

测试访问需要输入密码

需要特定的目录进行验证则需要在location中进行指定

ngx_http_stub_status_module模块

猜你喜欢

转载自www.cnblogs.com/Mrchengs/p/11941781.html