server.ip for "undoing" namevirtualhosts issues

Poul-Henning Kamp phk at
Mon Jul 12 09:46:40 CEST 2010

In message <4C3AAFE7.3010306 at>, Chris Hecker writes:

>Can I use server.ip in vcl_recv to force the host to the right site if 
>there's no host record?  What would the code look like to do this? 
>Something like:
>if(! {
>	if(server.ip == "a.b.c.d") {
>		set = "";
>	} elsif(server.ip == "a.b.c.e") {

Yes, that is server.ip was intended to be used.

If that does not work, it is a bug.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-misc mailing list