Serving Backends

Davies Matt J A (LCSS) mjdavies at glam.ac.uk
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 (req.http.host == "www.a.com") {
        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 http.host value of www.a.com will serve the cached backend.

Can anyone point me in the right direction here?

Thanks

Matt






More information about the varnish-misc mailing list