nginx-http之access[allow,deny](三)

语法

描述

// 按先后次序匹配
// 192.168.1.1 拒绝
// 192.168.1.0/24允许除192.168.1.1外
// 10.1.1.0/16, 2001:0db8::/32 允许
// 其他拒绝

location /test {
    deny  192.168.1.1;
    allow 192.168.1.0/24;
    allow 10.1.1.0/16;
    allow 2001:0db8::/32;
    deny  all;    
}

limit_except

// 指定GET请求
limit_except GET {
    allow all;
}
原文地址:https://www.cnblogs.com/pengsn/p/13689310.html