Minimalistic VCL does not compile

Viktor Gunnarson viktor.gunnarson at ericsson.com
Wed Oct 14 13:13:07 CEST 2015


Hi,

There is no such thing as req.backend, I think what you are looking for 
is req.backend_hint but as you only have the default backend defined you 
do not need to specify it at all. You should however add "set" in front 
of the setting of the variables and the line "vcl 4.0;" first in the 
file as I hope you are running Varnish 4 or later.

    vcl 4.0;

    backend default {
             .host = "46.228.47.114";
             .port = "https";
    }

    sub vcl_recv {
             set req.http.host = "www.yahoo.com";
    }


Best regards,
Viktor

On 14/10/15 13:01, dE wrote:
> Hi!
>
> I got this VCL --
>
> backend default {
>         .host = "46.228.47.114";
>         .port = "https";
> }
>
> sub vcl_recv {
>         req.backend = "default";
>         req.http.host = "www.yahoo.com";
> }
>
> But running varnishd complaints --
>
> Message from VCC-compiler:
> Expected an action, 'if', '{' or '}'
> ('input' Line 9 Pos 9)
>         req.backend = "default";
> --------###########-------------
>
> Running VCC-compiler failed, exit 1
>
> VCL compilation failed
>
> Thanks for any help!
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20151014/77a4b509/attachment.html>


More information about the varnish-misc mailing list