This small script does install all necessary parts to get nginx, varnish and apache running on your CentOS:

yum install screen sysstat net-snmp htop
rpm --nosignature -i
yum install varnish
rpm -Uvh epel-release-5-4.noarch.rpm 
yum install nginx
chkconfig varnish on
chkconfig httpd on
chkconfig nginx on
vi /etc/nginx/nginx.conf
vi /etc/nginx/conf.d/virtual.conf 
vi /etc/varnish/default.vcl 
vi /etc/httpd/conf/httpd.conf

A newer post about the subject in my web server talk.