question about the multiple backends

Sharl.Jimh.Tsin amoiz.shine at gmail.com
Sat Sep 11 15:03:15 CEST 2010


hi,everyone

i have a varnish(2.1.3) server and some httpd server likes
lighttpd、nginx and so on.now i let varnish send the request to
different server by domain url.

this is my configure:

backend to_cherokee {
    .host = "127.0.0.1";
    .port = "81";
}

backend to_lighttpd {
    .host = "127.0.0.1";
    .port = "82";
}

backend to_nginx {
    .host = "127.0.0.1";
    .port = "83";
}

sub vcl_recv {

if (req.http.host ~ "^(\w*\.)?aaaaaaaaa.cn$") {
        set req.backend = to_cherokee;
} elseif (req.http.host ~ "^(\w*\.)?bbbbbbbbbbbb.cn$") {
        set req.backend = to_nginx;
} else {
        set req.backend = to_lighttpd;
}
}

BUT it don't works. any wrong with them? WANT your HELP!!

Best regards,
Sharl.Jimh.Tsin (From China)




More information about the varnish-misc mailing list