nginx过滤带有反斜杠“\”的请求

nginx过滤带有test的请求:http://127.0.0.1:81/test

location / {
   if ($request_uri ~* "test") {
     return 404;
   }
  proxy_pass http://127.0.0.1:80/;
}

nginx过滤带有反斜杠的请求:http://127.0.0.1:81/test?id=index\root

四个斜杠"\\\\"代表反斜杠

location / {
   if ($request_uri ~* "\\\\") {
     return 404;
   }
  proxy_pass http://127.0.0.1:80/;
}
正在加载评论...