Skip to content

Instantly share code, notes, and snippets.

@cooka
Forked from jaxbot/gist:5748513
Created November 3, 2016 17:03
Show Gist options
  • Save cooka/063a7d8993abb9d71085418a2ee70133 to your computer and use it in GitHub Desktop.
Save cooka/063a7d8993abb9d71085418a2ee70133 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