Your evaluations aren't in any defined functions. Try placing them on vcl_recv. Also you should escape your periods in your regexes.

Paul Procacci pprocacci at
Mon Jul 19 03:43:14 CEST 2010

What's the error?

Yves Choi <yves1 at> wrote:

Dear all,

I am testing the Vanish for the reverse proxy for multilple domains.

Like as below diagram, When user access to (request http host name with<> ,the Vanish foreard the request to<> backend server.

user 1                                                                  Domain<>

user 2                    Vanish (10.10.10.x)                  Domain<>

user 3                                                                  Domain<>

I looked up the main page but can't find a right sample for this configuration.

This is a configuration that I add in the default vcl file.

When I start the vanishd with below configuration , I got an error.

Please let me know what I made a mistake.



---------------- error messages ---------------------

Expected one of
 'acl', 'sub', 'backend',  or 'director'
Found: 'if' at
(input Line 16 Pos 1)
if ( ~ "^(www.)?$<http://www.%29?$>") {
Running VCC-compiler failed, exit 1
VCL compilation failed


------------ VCL Configuration ----------------------

backend aaa {
     .host = "";
     .port = "80";
backend bbb {
     .host = "";
     .port = "80";

if ( ~ "^(www.)?$<http://www.%29?$>") {
   set = "<>";
   set req.backend = aaar;

} else if ( ~ "^(www.)?$<http://www.%29?$>" {
   set = "www.bbb.<http://www.bbb.>cpm";
   set  req.backend = bbb;}
  else {
         req.backend = default.;



This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.

More information about the varnish-misc mailing list