Caching Ghost 4 with Varnish Cache

Hi all,

Has anyone managed to setup Varnish Cache successfully with Ghost 4?

I’m new to Varnish and would love to see an example configuration.

My stack is the typical - Nginx with MySQL on a Digital Ocean Droplet. http requests are automatically forwarded to https through Nginx.

I was using Nginx Caching but realised it doesn’t play nice with the Portal / Membership feature. I.e when a user logged in they were still seeing the “login to read this post” as the page was cached.

From my understanding, Varnish has the flexibility to manage this scenario.

Any examples would be appreciated.