Re: location and file extension regex

2016-12-03 Thread Musta Fa
oh this is insane now i open chrome incognito window and it works!! how is that even possible? how can browser still downloading this file? while new incognito session obeys nginx rules?? On Sat, Dec 3, 2016 at 2:54 PM, Francis Daly wrote: > On Sat, Dec 03, 2016 at 02:27:50PM +, Musta Fa wr

Re: location and file extension regex

2016-12-03 Thread Francis Daly
On Sat, Dec 03, 2016 at 02:27:50PM +, Musta Fa wrote: Hi there, > while i request files > http://domain.com/config.xml > or > http://domain.com/include/config.xml > both files downloaded, which is not good, When I do it: $ curl http://127.0.0.1:/config.xml Did match: /config.xml $ curl

Re: location and file extension regex

2016-12-03 Thread Musta Fa
while i request files http://domain.com/config.xml or http://domain.com/include/config.xml both files downloaded, which is not good, simple ~* /\.(tpl|xml)$ {return 404;} works perfect but blocks files everywhere. On Sat, Dec 3, 2016 at 2:07 PM, Francis Daly wrote: > On Sat, Dec 03, 2016 at 1

Re: location and file extension regex

2016-12-03 Thread Francis Daly
On Sat, Dec 03, 2016 at 12:19:44PM +, Musta Fa wrote: Hi there, > 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 b

location and file extension regex

2016-12-03 Thread Musta Fa
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