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.