varnishncsa and negative matches on hostname

Bryan Stillwell bstillwell at
Tue Sep 27 00:53:09 CEST 2011

I'm trying to figure out how I could use varnishncsa with a bunch of
vhosts and then have an additional catchall for everything else.

For example I have something like:

/usr/bin/varnishncsa -a -w /var/log/varnish/foo/access.log -D -P
/var/run/ -m 'RxHeader:Host:
/usr/bin/varnishncsa -a -w /var/log/varnish/bar/access.log -D -P
/var/run/ -m 'RxHeader:Host:

Which will put logs destined for foo3-foo9 into
/var/log/varnish/foo/access.log, and logs destined for bar2-bar9 into
/var/log/varnish/bar/access.log.  However, I want everything else
(foo1, foo2, bar1, baz, etc.) to go into
/var/log/varnish/other/access.log.  What I believe I need is some kind
of negated match (perl's ~! or grep's -v option).  Unfortunately I'm
not seeing anything like that in the documentation.  Does anyone know
how to make something like this work right now?


More information about the varnish-misc mailing list