Varnish is distributed in the OpenBSD ports collection as ‘www/varnish’:
pkg_add varnish
cd /usr/ports/www/varnish make install
Installing on FreeBSD
Installing on RedHat or CentOS