The following are instructions to setup latest version of Varnish on various Linux distros.
CentOS 7
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish5/script.rpm.sh | sudo bash
Ubuntu
apt-get install apt-transport-https
curl https://repo.varnish-cache.org/GPG-key.txt ...
Varnish controls and manipulates HTTP requests using Varnish Configuration Language (VCL). The following snippet of VCL removes cookie from incoming requests to /images subdirectory:
sub vcl_recv {
if (req.url ~ "^/images") {
unset req.http.cookie;
}
}