Suppose I have the following in an nginx configuration file:
location ^~ /foo/ {
allow 1.2.3.4;
allow 5.6.7.8;
allow 9.10.11.12;
…
allow 99.100.101.102;
deny all;
# rest of directives
}
If I also want to restrict access to several other directories, is it possible to do so without having to create another block and list the IPs all over again? My concern is making changes when IPs are added and removed in the future — I would not want to have to make sure that each block was updated.
Even better would be a directive that basically allows me to "include" the list of IPs under each block somehow.