Skip to content

Instantly share code, notes, and snippets.

@nimolix
Created May 15, 2019 13:00
Show Gist options
  • Save nimolix/d75c12b53c46dd0ec695a65905eadfa3 to your computer and use it in GitHub Desktop.
Save nimolix/d75c12b53c46dd0ec695a65905eadfa3 to your computer and use it in GitHub Desktop.
Disallow access to .bzr, .git, .hg, .svn, .cvs directories: return 404 as not to disclose information.
location ^~ /.(bzr|git|hg|svn|cvs) {
return 404;
}
location ^~ /node_modules {
return 404;
}
location ^~ /Gruntfile.js {
return 404;
}
location ^~ /README.md {
return 404;
}
location ^~ /package.json {
return 404;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment