nginx之ngx_http_access_module模块使用
2016-06-19 19:13
218 查看
一,官方使用文档
官方使用文档路径:http://nginx.org/en/docs/http/ngx_http_access_module.html
#通过deny拒绝,allow允许命令,来限制和放开某些client IP的访问 location / { deny 192.168.1.1; allow 192.168.1.0/24; allow 10.1.1.0/16; allow 2001:0db8::/32; deny all; } ps:限制规则是按照顺序匹配的,上述例子表示:只容许IP4 192.168.1.0/24及10.1.1.0/16的IP和IP6 2001:0db8::/32的IP可以访问(排除192.168.1.1),其他IP都拒绝访问。
通过deny和allow命令,来控制客户端IP的访问。
阅读更多相关文章推荐
- 详细解释:nginx中ngx_http_access_module模块(HTTP Access 模块)配置及各个参数含义
- nginx之ngx_http_geo_module模块使用
- 详细解释:nginx中ngx_http_access_module模块(HTTP Access 模块)配置及各个参数含义
- 解剖Nginx·模块开发篇(3)ngx_http_hello_world_module 模块的基本函数实现
- Nginx模块 ngx_http_limit_req_module 限制请求速率
- nginx限制连接数(ngx_http_limit_conn_module)模块
- 在CentOS 6.9 x86_64上开启nginx 1.12.2的stub_status模块(ngx_http_stub_status_module)监控
- nginx 的第三方模块ngx_http_accesskey_module 来实现下载文件的防盗链步骤(linux系统下)
- 详细解释:nginx中ngx_http_auth_basic_module模块(HTTP Auth Basic 模块)配置及各个参数含义 .
- NGX_HTTP_REALIP_MODULE模块的使用
- nginx请求频率限制模块ngx_http_limit_req_module
- Nginx服务器工作状态ngx_http_stub_status_module 模块
- Nginx之http_image_filter_module模块使用
- nginx外部模块编译安装之ngx_http_accesskey_module防盗链
- Nginx Http认证 实现访问网站或目录密码认证保护 | 使用 HttpAuthBasicModule 模块
- 022_nginx常用模块之ngx_http_upstream_check_module
- nginx 动态缩略图模块安装(ngx_http_image_filter_module)
- nginx第三方模块(ngx_http_auth_pam_module)加注释
- 解剖Nginx·模块开发篇(5)解读内置非默认模块 ngx_http_stub_status_module
- Nginx模块 ngx_http_limit_conn_module 限制连接数