0

Varnish3 is ignoring the req.backend directive.

As explained on the documentation (here), I've set two backends, and the regex for redirecting the request to the correct one. By the way, seems liks Varnish is just ignoring the directive, obviously I'm missing something :-)

I want to catch awesomedomain.it as well as awesomedomain.it/whatever, while all the others domain just should point to default backend.

Any help is appreciated.

backend local {
    .host = "127.0.0.1";
    .port = "8000";
}

backend default {
    .host = "10.8.0.2";
    .port = "80";
}

sub vcl_recv {

if (req.http.host ~ "/awesomedomain\.it/") {
    set req.backend = local;
    }
}

1 Answer 1

0

The first backend is the default backend. The name of the backend doesn't matter

1
  • Weird, all my domains are redirected to the "default" backend, even if its not the first.
    – JonSnow
    Oct 11, 2014 at 10:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .