官网解读-nginx-ngx_http_auth_basic_module

Module ngx_http_auth_basic_module
Example Configuration(配置举例)
Directives(指令)

 auth_basic
 auth_basic_user_file

The ngx_http_auth_basic_module module allows limiting access to resources by validating the user name and password using the “HTTP Basic Authentication” protocol.
// ngx_http_auth_basic_module 模块允许限制对资源的访问,通过以 “HTTP Basic Authentication” 协议的方式验证用户名和密码的方式。
Access can also be limited by address, by the result of subrequest, or by JWT. Simultaneous limitation of access by address and by password is controlled by the satisfy directive.//访问控制可以通过限制地址,子请求的结果,JWT来实现。通过密码和地址同时限制访问是通过satisfy指令来实现的。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Example Configuration(配置举例)

location / {
    auth_basic           "closed site";//关闭网络
    auth_basic_user_file conf/htpasswd;
}
Directives
Syntax:	auth_basic string | off;
Default:	
auth_basic off;
Context:	http, server, location, limit_except

Enables validation of user name and password using the “HTTP Basic Authentication” protocol. The specified parameter is used as a realm. Parameter value can contain variables (1.3.10, 1.2.7). The special value off allows cancelling the effect of the auth_basic directive inherited from the previous configuration level.
//通过使用HTTP Basic Authentication协议验证用户名和密码。特殊的参数被用作一个领域,参数值包含变量(1.3.10,1.2.7)。特殊值off允许取消从上一级继承的auth_basic指令的影响。
在这里插入图片描述
在这里插入图片描述
Syntax: auth_basic_user_file file;
Default: —
Context: http, server, location, limit_except
Specifies a file that keeps user names and passwords, in the following format:
//制定一个用下面的格式保存用户名和密码的文件。

comment

name1:password1
name2:password2:comment
name3:password3
The file name can contain variables.//文件名可以包含变量。

The following password types are supported:

encrypted with the crypt() function; can be generated using the “htpasswd” utility from the Apache HTTP Server distribution or the “openssl passwd” command;
hashed with the Apache variant of the MD5-based password algorithm (apr1); can be generated with the same tools;//使用crypt()函数加密。可以使用Apache http server发布的htpasswd程序生成,或者是使用openssl passwd命令。
在这里插入图片描述
在这里插入图片描述
specified by the “{scheme}data” syntax (1.0.3+) as described in RFC 2307; currently implemented schemes include PLAIN (an example one, should not be used), SHA (1.3.13) (plain SHA-1 hashing, should not be used) and SSHA (salted SHA-1 hashing, used by some software packages, notably OpenLDAP and Dovecot).
Support for SHA scheme was added only to aid in migration from other web servers. It should not be used for new passwords, since unsalted SHA-1 hashing that it employs is vulnerable to rainbow table attacks.

**

单词:

**
Directives
英 [dɪˈrɛktɪvz] 美 [daɪˈrɛktɪvz]
指令类;编译指令;指令元件;指令符号;指示类言语行为
validating
英 [ˈvælɪdeɪtɪŋ] 美 [ˈvælɪdeɪtɪŋ]
v.
证实;确认;确证;使生效;使有法律效力;批准;确认…有效;认可
validate的现在分词
simultaneous
英 [ˌsɪmlˈteɪniəs] 美 [ˌsaɪmlˈteɪniəs]
adj.
同时发生(或进行)的;同步的
satisfy
英 [ˈsætɪsfaɪ] 美 [ˈsætɪsfaɪ]
v.
使满意;使满足;满足(要求、需要等);向…证实;使确信
Authentication
英 [ɔːˌθentɪˈkeɪʃn] 美 [ɔːˌθentɪˈkeɪʃn]
认证功能;验证方式;安全验证;报文鉴别;认证
specified
英 [ˈspesɪfaɪd] 美 [ˈspesɪfaɪd]
v.
具体说明;明确规定;详述;详列
realm
英 [relm] 美 [relm]
n.
领域;场所;王国
variables
英 [ˈveərɪəblz] 美 [ˈvɛriəbəlz]
n.
可变情况;变量;可变因素
inherited
英 [ɪnˈherɪtɪd] 美 [ɪnˈherɪtɪd]
v.
继承(金钱、财产等);经遗传获得(品质、身体特征等);接替(责任等);继任
variables
英 [ˈveərɪəblz] 美 [ˈvɛriəbəlz]
n.
可变情况;变量;可变因素
previous
英 [ˈpriːviəs] 美 [ˈpriːviəs]
adj.
先前的;以往的;(时间上)稍前的
format
英 [ˈfɔːmæt] 美 [ˈfɔːrmæt]
n.
总体安排;计划;设计;(出版物的)版式,开本;格式
v.
格式化;安排…的版式
encrypted
英 [ɪnˈkrɪptɪd] 美 [ɪnˈkrɪptɪd]
v.
把…加密(或编码)
utility
英 [juːˈtɪləti] 美 [juːˈtɪləti]
n.
公用事业;实用;效用;有用;实用程序;公用程序
adj.
多用途的;多效用的;多功能的
distribution
英 [ˌdɪstrɪˈbjuːʃn] 美 [ˌdɪstrɪˈbjuːʃn]
n.
分配;分布;分发;分送;(商品)运销,经销,分销
algorithm
英 [ˈælɡərɪðəm] 美 [ˈælɡərɪðəm]
n.
算法;计算程序
variant
英 [ˈveəriənt] 美 [ˈveriənt]
n.
变种;变体;变形
adj.
变异的;不同的,相异的,不一致的;多样的;易变的,不定的
unsalted
英 [ʌnˈsɔːltɪd] 美 [ʌnˈsɔːltɪd]
adj.
未放盐的;不加盐的
migration
英 [maɪˈɡreɪʃn] 美 [maɪˈɡreɪʃn]
n.
迁移;移居;迁徙;(计算机系统的)改变;(程序或硬件的)迁移,转移

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值