best configuration for varnish and multiple IPs and vhosts?

Jim Hayter jhayter at
Tue Jun 22 16:29:00 CEST 2010

Similar to Martin, we've been using option 1 for about four months now.
One thing I did differently, I put nginx in front of varnish to handle
both http and https connections and proxy them back to varnish.  Varnish
sits in front of two sets of web servers and selects the backend
director based on the hostname.


-----Original Message-----
From: varnish-misc-bounces at
[mailto:varnish-misc-bounces at] On Behalf Of Chris
Sent: Monday, June 21, 2010 7:34 PM
To: varnish-misc at
Subject: best configuration for varnish and multiple IPs and vhosts?

I searched around for an answer to this, but wasn't able to find 
anything comprehensive, so I'll ask here.  I'm a total newbie at this 
stuff, so please let me know if I missed some obvious link.

I have a single webserver with 5 IP addresses.  Each IP has at least one

apache-based site on it, and sometimes there are multiple on a single IP

via NameVirtualHost.  None of the sites share any content.

What is the best varnish setup for this?  It seems there are multiple 

1.  Have a single varnishd listen on all the IPs and run them all 
through a single apache port with name virtual hosts, so it's one big

2.  Multiple varnish daemons, one per IP, apache listening on multiple 
ports, one per IP for the back end?

3.  Something else entirely?

I don't have a ton of memory, if that matters.  I need to use a cache 
mostly to handle spikes from being reddited and whatnot, the normal 
daily load is fine for the server.


varnish-misc mailing list
varnish-misc at

More information about the varnish-misc mailing list