Wordpress varnish 4.0 VCL错误:运行VCC编译器失败
我使用varnish 4.0,然后执行这些操作 vi/etc/varnish/default.vclWordpress varnish 4.0 VCL错误:运行VCC编译器失败,wordpress,varnish,varnish-vcl,Wordpress,Varnish,Varnish Vcl,我使用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 cl
# 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;
}
}
执行此命令时,I/etc/init.d/varnish重新启动
收到此错误消息
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
那么,如何解决这个问题呢
谢谢 如前所述:
req.*在vcl_后端_响应中不可用
req.*以前可用
在vcl_fetch中,但在功能分割之后,您只有
vcl_后端_响应中的“bereq.*”
我认为这个链接已经过时了。使用这个: