欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

nginx匹配url进行拒绝访问 有大用

server {
    #获取url完整请求
    set $URL  $scheme://$http_host$request_uri;
    #根据获取的URL匹配一些限制字符,满足条件拒绝访
    #这里匹配 远程代码执行漏洞- "\x03\x00\x00/*\xE0\x00\x00\x00\x00\x00Cookie: mstshash=Administr"
    if ($URL ~ "Administr"){
        return 405;
    }
}

来自  https://www.cnblogs.com/chenjw-note/p/14844622.html



Nginx配置文件中增加:

location = /path/ {

   return 404 ;

}


普通分类: