Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Sensitive file blocking in location not working

$
0
0
So you know I said I'd tried every pattern? Well I went back, CTRL-Z in the editor and I found that actually I had skipped one:

This DOES work!

location ~* \.(pl|cgi|py|sh|lua|log|md5)$ {
return 444;
}

What had happened was that I hadn't noticed that I had left the )\$ on from another example.

Question: What is the purpose of that )\$ at the end of the closing bracket? I got the example from here:
http://www.queryadmin.com/1071/deny-access-sensitive-files-nginx/

I'd like to go back and tell the page owner that it's incorrect, but does it ever hold a valid context or is it just an annoying typo that cost me an hour?

Thanks - and sorry for taking your time, but I was copying one of the many bad configs off the internet!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>