I have different files inside three different directories.
I'd like to block access to all files inside those whatever the file extension (and also block directory listing).
For example:
domain.com/folder/a/file
domain.com/folder/b/file
domain.com/folder/c/file
So far, the bellow is working:
location ~ /folder/(a|b|c) {
allow 1.2.3.4;
deny all;
return 403;
}
However, it is also blocking the access to files on domain.com/folder/ (which I don't want). Besides, when I make a simples ajax call for some php file inside one of the blocked folders (from some of the sites hosted on the IP 1.2.3.4) the call is also blocked.
Any suggestions of how I can fix this?
Thanks.