Skip to content

Instantly share code, notes, and snippets.

@wyw
Forked from jaxbot/gist:5748513
Created September 28, 2018 08:30
Show Gist options
  • Save wyw/e02749e6bd4948fbfb44100c4e202e39 to your computer and use it in GitHub Desktop.
Save wyw/e02749e6bd4948fbfb44100c4e202e39 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