23 Jun 2016
匹配规则:
和apache不同,nginx采取了和iptables规则差不多的逻辑
从上往下匹配,执行匹配到的第一条规则,停止继续向下匹配
例如:
deny all;
allow 192.168.0.1;
后面一条allow规则会被忽略,因为所有的ip都匹配deny all
可配置directives:
http, server, location, limit_except
语法:
allow address | CIDR | unix: | all;
deny address | CIDR | unix: | all;
支持unix socket文件
扩展阅读:https://nginx.org/en/docs/http/ngx_http_access_module.html