In reply to Michael.

Hi Michael, thanks for your appreciation. :-)

You can use nginx's 3rd party-module https://github.com/openresty/headers-more-nginx-module to intercept cookies as well as other HTTP headers.

For logged in users - nginx can use WordPress cookie `wordpress_logged_in` to bypass cache. Example - https://github.com/rtCamp/easyengine/blob/master/config/nginx/common/wpfc.conf#L21-23

I never used Varnish so it will be incorrect on my part to compare it's flexibility with Nginx. But is last 5 years, we haven't come across any case where nginx cache failed to deliver.

Nginx core + 3rd party modules together provides many different cache solutions.

We maintain custom builds of nginx on Launchpad - https://launchpad.net/~rtcamp/+archive/ubuntu/nginx . With these builds, you may try many 3rd party nginx modules without compiling nginx from source on Ubuntu.