Skip to main content Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed

NGINX: Hide / Block .git and .svn folders

Published: 13-03-2013 | Author: Remy van Elst | Text only version of this article

❗ This post is over eleven years old. It may no longer be up to date. Opinions may have changed.

This little nginx config snippets helps you prohibit access to .git or .svn folders in nginx

location ~ /\.git {
  deny all;

It should be places in a server block. Works for both http as well as https.

Tags: access , git , nginx , server , snippets , svn