varnish - 防止将cookie "x-bni-ci"清除到 Varnish 中

标签 varnish varnish-vcl varnish-4

我们正在尝试防止cookie x-bni-ci被 Varnish 剥离。我们有一行删除vcl文件中无法识别的cookie:

  set req.http.Cookie = regsuball(req.http.Cookie, ";[^ ][^;]*", "");

必须允许所有URL使用cookie。

我们正在使用 Varnish 4

最佳答案

您可以安装VMOD cookie吗?

如果是这样,您可以执行以下操作...

import cookie;

    sub vcl_recv {
            cookie.parse(req.http.Cookie);
            cookie.filter_except("x-bni-ci");
    }

关于varnish - 防止将cookie "x-bni-ci"清除到 Varnish 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37025536/

相关文章:

Magento 1.6.1 - 从购物车中删除重定向到主页(运行 Varnish)

Magento 与 Nginx 和 Varnish - 302、cookie 和重定向?

caching - varnish param.set 在服务重启后重置为以前的值

magento - Varnish 缓存清空 Magento 中的购物车

varnish - 修改Varnish默认文件后出现Err_Connection_Refused

varnish - 查看 Varnish 缓存未命中的URL和后端IP

nginx - 特定数量的请求后,在Varnish-Cache中缓存资源

Varnish http_req_hdr_len 参数不适用于请求 header 大小 > 8KB

regex - Varnish 3 没有正确解析正则表达式模式

caching - Varnish 4以从具有不同内容的多台服务器缓存