Using Varnish 3.0.7. In order to forward any non-SSL connections I've added the following subroutine to my VCL:
sub vcl_synth {
if (resp.status == 750) {
set resp.status = 301;
set resp.http.Location = req.http.x-redir;
return(deliver);
}
}
And then in vcl_recv
I've added:
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, ""));
}
But I'm getting the following error:
Message from VCC-compiler:
Expected return action name.
('input' Line 225 Pos 16)
return(synth(750, ""));
---------------#####------------
Does anyone know why this is happening? I'm clueless after several hours of debugging...
Many thanks!