Varnish with Ghost?

Does anyone know how to get Ghost set up with Varnish? I was trying to set up the below setup, but it either comes up with a 502 error or Error connection refused.

VM with NGINX and Varnish
- NGINX terminates SSL to Varnish on Port 80.
- Varnish is pointing to my Ghost VM on port 80

VM with NGINX and Ghost

  • NGINX does a proxy pass from port 80 to Ghost

Am I missing something with the setup, or am I doing it completely wrong?

Any help would be appreciated. I have spent the last few weeks searching and couldn’t find anything…