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提供

Nginx http_auth_basic_module(访问控制功能)

 

 

创建一个http-tools
pw:123456

Nginx http_auth_basic_module(访问控制功能)

 

 Nginx http_auth_basic_module(访问控制功能)

 

 

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

Nginx http_auth_basic_module(访问控制功能)

 

 

修改配置文件

Nginx http_auth_basic_module(访问控制功能)

 

 

测试访问需要输入密码

Nginx http_auth_basic_module(访问控制功能)

 

 

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

ngx_http_stub_status_module模块

 

 

相关文章:

  • 2021-07-01
  • 2022-01-14
  • 2022-02-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-17
  • 2021-11-27
  • 2021-11-27
  • 2021-09-24
  • 2021-06-26
相关资源
相似解决方案