nginx 禁止对.svn 目录访问

来源:互联网 发布:java cache类 编辑:程序博客网 时间:2024/05/19 03:22

   location ~* /(\.svn|CVS|Entries){

    deny all;

    }


    location ~ ^(.*)\/\.svn\/{
        deny all;

    }

 location ~* /\.svn/ {

 deny all;

    }


注意以上方案1 和 方案2 以及方案3 都可以禁止对 static/visamis/asset/common/js/umeditor/dialogs/formula/.svn/all-wcprops 这样的包含.svn在中间的 url访问(403)

location ~* /h5/ {
        deny all;
    }

禁止 对 visa/h5/index访问


说明nginx location 后面的正则匹配 是完全符合 正则匹配过程的 先从0位置开始匹配模式,然后从1位置。。。


0 0
原创粉丝点击