On Nginx add the following to each “server” block:
1 2 3 4 5 6 |
location ~ /\.git { deny all; } location ~ /\.svn { deny all; } |
And the for Apache add the following to the VirtualHost block:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<Directorymatch "^/.*/\.git+/"> Order deny,allow Deny from all </Directorymatch> <Files ~ "^\.git"> Order allow,deny Deny from all </Files> <Directorymatch "^/.*/\.svn+/"> Order deny,allow Deny from all </Directorymatch> <Files ~ "^\.svn"> Order allow,deny Deny from all </Files> |