I have a location block at / (root) level and a location block at a particular folder level such as /some-folder In the location block for some-folder, i have added a custom header, so that i can determine if nginx is activating that block. When i make a call to a resource such as /some-folder/a.html, i can see custom header coming back, but the try_files $uri $uri/ =404; returning me 404 for a.html
If i comment the location block for /some-folder and just leave the root block and then make a call again to /some-folder/a.html, nginx happily serves the file.
I am confused why root block is able to serve the file, and why /some-folder location block fails, even though it is being activated as i get 404 back with my custom header.
root
is not correctly defined for thatlocation
. – Richard Smithserver
block to understand what's happening. – Richard Smith