gpt4 book ai didi

ssl - Varnish 3 : "Expected return action name" when using "synth"

转载 作者:太空宇宙 更新时间:2023-11-03 12:51:15 30 4
gpt4 key购买 nike

使用 Varnish 3.0.7。为了转发任何非 SSL 连接,我将以下子例程添加到我的 VCL 中:

sub vcl_synth {
if (resp.status == 750) {
set resp.status = 301;
set resp.http.Location = req.http.x-redir;
return(deliver);
}
}

然后在 vcl_recv 中我添加了:

if ((req.http.host ~ "^(?i)mydomain(?i)") && req.http.X-Forwarded-Proto !~ "(?i)https") {
set req.http.x-redir = "https://" + req.http.host + req.url;
return(synth(750, ""));
}

但我收到以下错误:

Message from VCC-compiler:
Expected return action name.
('input' Line 225 Pos 16)
return(synth(750, ""));
---------------#####------------

有人知道为什么会这样吗?经过几个小时的调试,我一无所知......

非常感谢!

最佳答案

vcl_synthreturn(synth(750, "")) 在 Varnish Cache 3.x 中不存在。这是仅在 4.x 中有效的语法。在 3.x 中,vcl_synth 应替换为 vcl_errorreturn(synth(750, "")) 应替换为 error 750.

关于ssl - Varnish 3 : "Expected return action name" when using "synth",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34529383/

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