Protect .svn folders on Apache or Nginx web servers

Sometimes I use subversion (svn) to publish my latest web sources to web servers and it’s always good to secure your .svn folders on the web server. You can easily do it for an Apache and nginx web servers.

I have published quick config examples below – feel free to use!

Apache config httpd.conf:

<DirectoryMatch .*\.svn/.*>
Deny From All
</DirectoryMatch>

Nginx config nginx.conf:

location ~ /.svn/ {
deny all;
}


Comments

  1. Dude says:

    Order allow,deny
    Deny from all

  2. Dude says:

    <Directory ~ "\.svn">
    Order allow,deny
    Deny from all
    </Directory>

Leave a Reply