Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_access_module.xml @ 2917:a2708cf6ebdb
Fixed typo in the sticky directive.
author | Sergey A. Osokin <osa@FreeBSD.org.ru> |
---|---|
date | Wed, 14 Dec 2022 18:16:49 +0300 |
parents | a7974b8d2a23 |
children | 9eadb98ec770 |
rev | line source |
---|---|
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
2 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
494
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
494
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
494
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
494
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
494
diff
changeset
|
7 |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
9 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
10 <module name="Module ngx_http_access_module" |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
11 link="/en/docs/http/ngx_http_access_module.html" |
589 | 12 lang="en" |
1763
a7974b8d2a23
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
971
diff
changeset
|
13 rev="4"> |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 <section id="summary"> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
16 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
17 <para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
18 The <literal>ngx_http_access_module</literal> module allows |
966 | 19 limiting access to certain client addresses. |
494
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
20 </para> |
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
21 |
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
22 <para> |
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
23 Access can also be limited by |
1763
a7974b8d2a23
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
971
diff
changeset
|
24 <link doc="ngx_http_auth_basic_module.xml">password</link>, by the |
a7974b8d2a23
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
971
diff
changeset
|
25 <link doc="ngx_http_auth_request_module.xml">result of subrequest</link>, |
a7974b8d2a23
Updated docs for the upcoming NGINX Plus release.
Ruslan Ermilov <ru@nginx.com>
parents:
971
diff
changeset
|
26 or by <link doc="ngx_http_auth_jwt_module.xml">JWT</link>. |
494
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
27 Simultaneous limitation of access by address and by password is controlled |
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
28 by the <link doc="ngx_http_core_module.xml" id="satisfy"/> directive. |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 </para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 </section> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 <section id="example" name="Example Configuration"> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
36 <para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
37 <example> |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
315
diff
changeset
|
38 location / { |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
315
diff
changeset
|
39 deny 192.168.1.1; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
315
diff
changeset
|
40 allow 192.168.1.0/24; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
315
diff
changeset
|
41 allow 10.1.1.0/16; |
494
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
42 allow 2001:0db8::/32; |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
315
diff
changeset
|
43 deny all; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
315
diff
changeset
|
44 } |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
45 </example> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 </para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
48 <para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 The rules are checked in sequence until the first match is found. |
966 | 50 In this example, access is allowed only for IPv4 networks |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 <literal>10.1.1.0/16</literal> and <literal>192.168.1.0/24</literal> |
494
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
52 excluding the address <literal>192.168.1.1</literal>, |
244500f24783
- Cross linked ngx_http_access_module and ngx_http_auth_basic_module,
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
53 and for IPv6 network <literal>2001:0db8::/32</literal>. |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 In case of a lot of rules, the use of the |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 <link doc="ngx_http_geo_module.xml">ngx_http_geo_module</link> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 module variables is preferable. |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 </para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
58 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 </section> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
60 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
62 <section id="directives" name="Directives"> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
63 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
64 <directive name="allow"> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
65 <syntax> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
66 <value>address</value> | |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
67 <value>CIDR</value> | |
921
d7991f499d9f
Access: support for UNIX-domain client addresses (ticket #359).
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
68 <literal>unix:</literal> | |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
69 <literal>all</literal></syntax> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
70 <default/> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
71 <context>http</context> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 <context>server</context> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
73 <context>location</context> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
74 <context>limit_except</context> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
75 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
76 <para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 Allows access for the specified network or address. |
921
d7991f499d9f
Access: support for UNIX-domain client addresses (ticket #359).
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
78 If the special value <literal>unix:</literal> is specified (1.5.1), |
d7991f499d9f
Access: support for UNIX-domain client addresses (ticket #359).
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
79 allows access for all UNIX-domain sockets. |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
80 </para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
81 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 </directive> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
83 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
84 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
85 <directive name="deny"> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
86 <syntax> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
87 <value>address</value> | |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
88 <value>CIDR</value> | |
921
d7991f499d9f
Access: support for UNIX-domain client addresses (ticket #359).
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
89 <literal>unix:</literal> | |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
90 <literal>all</literal></syntax> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
91 <default/> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
92 <context>http</context> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
93 <context>server</context> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
94 <context>location</context> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
95 <context>limit_except</context> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
96 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
97 <para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
98 Denies access for the specified network or address. |
921
d7991f499d9f
Access: support for UNIX-domain client addresses (ticket #359).
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
99 If the special value <literal>unix:</literal> is specified (1.5.1), |
d7991f499d9f
Access: support for UNIX-domain client addresses (ticket #359).
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
100 denies access for all UNIX-domain sockets. |
315
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
101 </para> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
102 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
103 </directive> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
104 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
105 </section> |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
106 |
e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
107 </module> |