location =/aaa {
allow 127.0.0.0/24;
allow 192.168.0.0/16;
allow 172.16.0.0/12;
allow 10.0.0.0/8;
deny all;
}
/aaa为需要禁止访问的路径

https://blog.csdn.net/gjy11011/article/details/124982884