仍然通过清漆返回排除网址

时间:2016-07-04 08:52:39

标签: varnish varnish-vcl varnish-4

我已从我的清漆缓存

中排除了这样的网址
if (req.url ~ "^/folder_name/") {
  return (pass);
}

但是当我访问curl -I http://ip/folder_name时,我会看到以下回复

HTTP/1.1 301 Moved Permanently
Date: Mon, 04 Jul 2016 08:48:46 GMT
Server: Apache/2.2.15 (CentOS)
Location: http://ip/folder_name/
Content-Length: 319
Content-Type: text/html; charset=iso-8859-1
X-Varnish: 294958
Age: 0
Via: 1.1 varnish-v4
Connection: keep-alive

任何人都可以告诉我,我做错了什么,我需要排除 "以/ folder_name"开头的所有网址来自varnisg缓存

1 个答案:

答案 0 :(得分:1)

你的正则表达式用斜线结尾,“http://ip/folder_name没有” - 这可能是吗?