Hello.
I'm trying (and failing) to write a `location` block to deny access to all files with extension `.abc` in the directory `/def/` and any (wildcard) subdirectory of `/def/`. I would be very grateful for some guidance and further reading.
For clarity, this `location` block is the first in the `server`, so there are no conflicts from a previous block. I have the `/def/` block scaffold, and the `.abc` block scaffold, but I am falling down on the regex glue that connects them.
My `/def/` block looks like this:
location ^~ /.well-known/ {
[…]
}
My `.abc` block looks like this:
location ~ ^.+\.abc?$ {
[…]
}
How can I merge those into a single block so that the `location` fires correctly for `*.abc` in `/def/` and any wildcard subdirectories of `/def/`?
Thank you for reading this far, and best wishes to you.