Blog

nginx directive to deny all access to .svn directories

When deploying a Rails application you should make sure not to put .svn folders on the server. If this is unevitable, you should at least deny the access to those.

Ever tried this on your domain?

 http://my_super_project.com/.svn/entries

If you are using nginx as a webserver and the link above serves you a download, you should add the following location-directive to your nginx.conf:

 location ~ /\.svn/* {
deny  all;
}

This directive should reside in your server{}  definition before all other location definitions.

Let me know if this works .. at least it did the job on my server.