Here are some of the Nginx prohibit SVN directory access to the script, I hope these scripts will help you learn Nginx oh.
Nginx
Location ~. *. (SVN|GIT|CVS) {
Deny all;
}
Apache
<directory "/opt/www/svip/gift/webroot" >
Rewriteengine on
Rewriterule. svn//404.html
</Directory>
To organize some methods for everyone to refer
Disable access to certain files/directories
Add the Files option to control, such as not allowing access to the. inc extension file, to protect the PHP class library:
<files ~ ". inc$" >
Order Allow,deny
Deny from all
</Files>
Prohibit access to certain specified directories: (can be used for regular matching)
<directory ~ "^/var/www/(. +/) *[0-9]{3}" >
Order Allow,deny
Deny from all
</Directory>
Prohibit by file matching, such as prohibiting all access to images:
<filesmatch. (? i:gif|jpe?g|png) $>
Order Allow,deny
Deny from all
</FilesMatch>
Forbidden access for URL-relative paths:
<Location/dir/>
Order Allow,deny
Deny from all
</Location>
Prohibit access to certain destinations (which can be used for regular matching) for proxy, such as denying access to 111cn.net through proxies:
<proxy http://www.111cn.net/*>
Order Allow,deny
Deny from all
</Proxy>