Serving Backends

Davies Matt J A (LCSS) mjdavies at
Fri Oct 1 16:22:37 CEST 2010

Hello everyone

I've defined a backend that is my application server,

backend a {
  .host = "application_server_fqdn";
  .port = "80";

and then defined some further code to serve that backend from my varnish server

sub vcl_recv {

if ( == "") {
        set req.backend = a;


What I'm finding is that if I make up anything in my /etc/hosts file to point at the varnish servers IP address, it will serve the site.  Even the IP address of the varnish server serves the application.

I don't want that to happen.

Am I missing something obvious here?  I thought that only requests with the value of will serve the cached backend.

Can anyone point me in the right direction here?



More information about the varnish-misc mailing list