Hidden directories and files should never be available on the Internet. General answer to your question:
location ~ /\. { return 403; }
This prohibits access to .git, .svn, .htaccess files and similar files in any subdirectory.
Jon Jaroker Sep 15 '13 at 16:50 2013-09-15 16:50
source share