Setup Varnish - Multiple Ipaddress

From Brian Nelson Ramblings
Jump to: navigation, search

Set Varnish to Listen on Multiple IP's

By default, varnish will listen on every ipaddress you add to the server.

Only listen to specific ipaddresses

Say you have a server with 3 ip's and you only want 2 to use varnish. You will have to edit the /etc/sysconfig/varnish file

vim /etc/sysconfig/varnish

And change the -a flag to include both ips' comma separated



Replace with

-a, \

Over all it will look like

            -f ${VARNISH_VCL_CONF} \
            -t ${VARNISH_TTL} \
            -u varnish -g varnish \
            -S ${VARNISH_SECRET_FILE} \
            -s ${VARNISH_STORAGE}"

Now you only have varnish listening to only a few of the ips on the server not all or 1.

Additional Articles