File tree Expand file tree Collapse file tree 2 files changed +53
-1
lines changed
Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 102102 - [ ngx_mail_smtp_module] ( 模块参考/mail/ngx_mail_smtp_module.md )
103103 - Stream
104104 - [ ngx_stream_core_module] ( 模块参考/stream/ngx_stream_core_module.md )
105- - ngx_stream_access_module
105+ - [ ngx_stream_access_module] ( 模块参考/stream/ngx_stream_access_module.md )
106106 - ngx_stream_geo_module
107107 - ngx_stream_geoip_module
108108 - ngx_stream_js_module
Original file line number Diff line number Diff line change 1+ # ngx_stream_access_module
2+
3+ - [ 示例配置] ( #example_configuration )
4+ - [ 指令] ( #directives )
5+ - [ allow] ( #allow )
6+ - [ deny] ( #deny )
7+
8+ ` ngx_stream_access_module ` 模块(1.9.2)允许对某些客户端地址限制访问。
9+
10+ <a id =" example_configuration " ></a >
11+
12+ ## 示例配置
13+
14+ ``` nginx
15+ server {
16+ ...
17+ deny 192.168.1.1;
18+ allow 192.168.1.0/24;
19+ allow 10.1.1.0/16;
20+ allow 2001:0db8::/32;
21+ deny all;
22+ }
23+ ```
24+
25+ 按顺序检查规则,直到找到第一个匹配项。在此示例中,仅允许 IPv4 网络 ` 10.1.1.0/16 ` 和 ` 192.168.1.0/24 ` (不包括地址 ` 192.168.1.1 ` )和 IPv6 网络` 2001:0db8::/32 ` 进行访问。
26+
27+ <a id =" directives " ></a >
28+
29+ ## 指令
30+
31+ ### allow
32+
33+ | \- | 说明|
34+ | ------:| ------|
35+ | ** 语法** | ** allow** ` address ` | ; ` CIDR ` | ; ` unix: ` | ; ` all ` ;|
36+ | ** 默认** | ——|
37+ | ** 上下文** | stream、server|
38+
39+ 允许指定的网络或地址访问。如果指定了值 ` unix: ` ,则允许访问所有 UNIX 域套接字。
40+
41+ ### deny
42+
43+ | \- | 说明|
44+ | ------:| ------|
45+ | ** 语法** | ** deny** ` address ` | ; ` CIDR ` | ; ` unix: ` | ; ` all ` ;|
46+ | ** 默认** | ——|
47+ | ** 上下文** | stream、server|
48+
49+ 拒绝指定的网络或地址访问。如果指定了值 ` unix: ` ,则拒绝所有 UNIX 域套接字的访问。
50+
51+ ## 原文档
52+ [ http://nginx.org/en/docs/stream/ngx_stream_access_module.html ] ( http://nginx.org/en/docs/stream/ngx_stream_access_module.html )
You can’t perform that action at this time.
0 commit comments