Varnish returns default host instead of virtual host

Caunter, Stefan scaunter at
Mon Jun 7 17:35:52 CEST 2010

-----Original Message-----
From: varnish-misc-bounces at [mailto:varnish-misc-bounces at] On Behalf Of Marcus Smith
Sent: June-07-10 11:21 AM
To: varnish-misc at
Subject: Re: Varnish returns default host instead of virtual host

Lars Monsees wrote:
> Hi,
> I am very new to Varnish and have only configured my backend as I
> guess Varnish will use default values that should work for the
> beginning. The problem is that Varnish returns the content of the
> server´s default domain (the standard "it work´s" text") instead of
> the content of the wanted domain.

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

It looks like the backend is on the same machine that varnish is running
on.  In that case, it needs to be listening on a port other than 80 as
you have above, as varnish will be bound to port 80 by default.

best wishes,

Hi Lars and Marcus:

Varnish would not start if the port was not available, and it's returning the default page because it doesn't know about a host header (yet).

Add this for your domain name.

if ( ~ "^(www.)?") {
                set = "";


More information about the varnish-misc mailing list