-
-
Save bean5/1245ecbb8976099daf5dcc8c2e76e8cd to your computer and use it in GitHub Desktop.
Block nginx from serving .git directories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ /\.git { | |
deny all; | |
} | |
# or, all . directories/files in general (including .htaccess, etc) | |
location ~ /\. { | |
deny all; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative at https://gist.github.com/jaxbot/5748513#gistcomment-3244643: