Well, I don't know what Varnish does so I can't tell you ! :-) 

BTW. NGINX save the response in the cache with a key. The key it uses is specified in the configuration with the directive http://wiki.nginx.org/HttpProxyModule#proxy_cache_key

You can use almost all the variables in the HTTP request to "build" your key. 

When you want to purge/delete a resource in the cache you must send a request, to the correct url, with the very same HTTP info so that NGINX can re-create the same key he used for storing.