Dear all,

 

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

 

Like as below diagram, When user access to 10.10.10.10 (request http host name with www.aaa.com ,the Vanish foreard the request to www.aaa.com backend server.

 

user 1                                                                  Domain www.aaa.com

 

user 2                    Vanish (10.10.10.x)                  Domain www.bbb.com

 

user 3                                                                  Domain www.ccc.com

 

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.

 

Regards,

 

Yves

 

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

Expected one of
 'acl', 'sub', 'backend',  or 'director'
Found: 'if' at
(input Line 16 Pos 1)
if (req.http.host ~ "^(www.)?aaa.com$") {
##-----------------------------------------
Running VCC-compiler failed, exit 1
VCL compilation failed

--------------------------------------------------------

 

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

backend aaa {
     .host = "1.1.1.1";
     .port = "80";
 }
backend bbb {
     .host = "2.2.2.2.";
     .port = "80";
 }

if (req.http.host ~ "^(www.)?aaa.com$") {
   set req.http.host = "www.aaa.com";
   set req.backend = aaar;

} else if (req.http.host ~ "^(www.)?bbb.com$" {
   set req.http.host = "www.bbb.cpm";
   set  req.backend = bbb;}
  else {
         req.backend = default.;
       }
}

 

 

_______________________________________________
varnish-misc mailing list
[email protected]
http://lists.varnish-cache.org/mailman/listinfo/varnish-misc

Reply via email to