comparison xml/cn/docs/http/ngx_http_auth_basic_module.xml @ 720:9934338f83af

Updated the Chinese documentation.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 11 Oct 2012 10:23:05 +0000
parents
children
comparison
equal deleted inserted replaced
719:6a37df6078a1 720:9934338f83af
1 <?xml version="1.0"?>
2
3 <!--
4 Copyright (C) Igor Sysoev
5 Copyright (C) Nginx, Inc.
6 -->
7
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9
10 <module name="ngx_http_auth_basic_module模块"
11 link="/cn/docs/http/ngx_http_auth_basic_module.html"
12 lang="cn"
13 translator="WenMing"
14 rev="1">
15
16 <section id="summary">
17
18 <para>
19 模块<literal>ngx_http_auth_basic_module</literal> 允许使用“HTTP基本认证”协议验证用户名和密码来限制对资源的访问。
20 </para>
21
22 <para>
23 也可以通过
24 <link doc="ngx_http_auth_basic_module.xml">地址</link>来限制访问。
25 使用<link doc="ngx_http_core_module.xml" id="satisfy"/> 指令就能同时通过地址和密码来限制访问。
26 </para>
27
28 </section>
29
30
31 <section id="example" name="配置范例">
32
33 <para>
34 <example>
35 location / {
36 auth_basic "closed site";
37 auth_basic_user_file conf/htpasswd;
38 }
39 </example>
40 </para>
41
42 </section>
43
44
45 <section id="directives" name="指令">
46
47 <directive name="auth_basic">
48 <syntax><value>string</value> | <literal>off</literal></syntax>
49 <default>off</default>
50 <context>http</context>
51 <context>server</context>
52 <context>location</context>
53 <context>limit_except</context>
54
55 <para>
56 开启使用“HTTP基本认证”协议的用户名密码验证。
57 指定的参数被用作 <value>域</value>。
58 参数<literal>off</literal>可以取消继承自上一个配置等级
59 <literal>auth_basic</literal> 指令的影响。
60 </para>
61
62 </directive>
63
64
65 <directive name="auth_basic_user_file">
66 <syntax><value>file</value></syntax>
67 <default/>
68 <context>http</context>
69 <context>server</context>
70 <context>location</context>
71 <context>limit_except</context>
72
73 <para>
74 指定保存用户名和密码的文件,格式如下:
75 <example>
76 # comment
77 name1:password1
78 name2:password2:comment
79 name3:password3
80 </example>
81 </para>
82
83 <para>
84 密码应该使用<c-func>crypt</c-func>函数加密。
85 可以用Apache发行包中的<command>htpasswd</command>命令来创建此类文件。
86 </para>
87
88 </directive>
89
90 </section>
91
92 </module>