gpt4 book ai didi

wordpress - Varnish 4.0 VCL错误: Running VCC-compiler failed

转载 作者:行者123 更新时间:2023-12-03 17:46:33 26 4
gpt4 key购买 nike

我使用 Varnish 4.0,并按照这些操作,

vi/etc/varnish/default.vcl

# Drop any cookies sent to WordPress.
sub vcl_recv {
     if ((req.url ~! "wp- (login | admin)")) {
         unset req.http.cookie;
     }
}

# Drop any cookies WordPress tries to send back to the client.
sub vcl_backend_response {
     if ((req.url ~! "wp- (login | admin)")) {
         unset beresp.http.set-cookie;
     }
}

执行此命令时我/etc/init.d/varnish restart

收到此错误消息。
Message from VCC-compiler:
Syntax error at
('input' Line 33 Pos 1)
    if (!(req.url ~ "wp-(login|admin)")) {
#-------------------------------------------

Running VCC-compiler failed, exited with 2

VCL compilation failed
* Syntax check failed, not restarting

那么,如何解决这个问题呢?

谢谢!

最佳答案

正如documentation所说:

req.* not available in vcl_backend_response

req.* used to be available in vcl_fetch, but after the split of functionality, you only have 'bereq.*' in vcl_backend_response.

关于wordpress - Varnish 4.0 VCL错误: Running VCC-compiler failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29174949/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com