Skip to content

Instantly share code, notes, and snippets.

@hrvoj3e
Forked from jaxbot/gist:5748513
Created November 15, 2018 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrvoj3e/030975f03f3762299cc6220914de5b0f to your computer and use it in GitHub Desktop.
Save hrvoj3e/030975f03f3762299cc6220914de5b0f 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