Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dennisvanderpool/6c0c9260cbcf9b7ad3af4182c57a41e4 to your computer and use it in GitHub Desktop.
Save dennisvanderpool/6c0c9260cbcf9b7ad3af4182c57a41e4 to your computer and use it in GitHub Desktop.
Block nginx from serving .git directories
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