Varnish and virtual Hosts configuration (Apache and Nginx)

If you want to use Varnish with Virtual Hosts, you may face the problem of Varnish showing only the default site and not all other virtual sites.Do not try to fix it tweaking Varnish, as this is something you need to solve in Apache or Nginx configuration, depending on which of them is behind varnish.In this post I'll show you how to configure both of them Nginx and Apache.