官網解讀-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.
遷移;移居;遷徙;(計算機系統的)改變;(程序或硬件的)遷移,轉移

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章