I'm using nginx as a proxy (with location /) and trying to serve a static image for hotlink protection redirects under another location block. The following is what I am using to try to serve the image. I've moved the root directive outside of the location block which was necessary for nginx to build a proper path for some reason.
location = /hotlink.png {
autoindex off;
try_files hotlink.png hotlink.png
}
However, when I look at the log, it is still looking for an index.html by appending the URI to the root path: {root}/hotlink.png/index.html.
I simply want it to only send the file {root}/hotlink.png when /hotlink.png is matched and that's it.
Why is it still looking for an index with autoindex off? How can I fix this or is there a better way to handle this case in general?
try_filesstatement. - Richard Smithtry_filesit seems to be skipping the block altogether and falling back thelocation /block - user1137704hotlink.pnga real file? - Richard Smith