If ESI is an absolute must I'd recommend the following set up
User -> Nginx (gzip+proxy+ssl termination) -> Varnish (ESI) -> Ngnix App Server.
That way you don't have to delegate your ssl, gzip requests to one back end server, and the ESI requests to another.
Have Varnish strip the Accept-Encoding headers from the incoming requests, that way your backends won't try to gzip (iff they're configured to do so), and Varnish can parse your backend response objects for ESI includes. Varnish will then present to your Nginx proxy
fully formed content. That leaves the Nginx proxy to do compression and SSL delivery.
I've got a very similar setup running in production (without the SSL termination), and I've found it works quite gracefully.