location and file extension regex

Musta Fa fam6837 at gmail.com
Sat Dec 3 12:19:44 UTC 2016


im trying to create some regex just to match before second slash and only.
and allow all subfolders:

location ~ ^/([^/])+\.(tpl|xml)$ { return 404; }

these files are located in root folder, and i dont want them to be
downloaded,
but other files in subfolder are downloadable.

not sure why it not working?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20161203/19de1b38/attachment.html>


More information about the nginx mailing list