Nginx running behind Varnish and x-forwarded-for, how to fool nginx

nginxreverse-proxyvarnishx-forwarded-for

I have a setup where I'm looking at running nginx behind a varnish cache. I currently use apache instead of varnish and use x-forwarded-for to have apache tricked into thinking the remoteip is the client ip address and not the proxy address.

I've been trying to google if this is possible with nginX, but so far I've not found any solid leads. Please tell me it is indeed possible!

Best Answer