Logging the client IP with Nginx/Varnish/Apache

me at ibotty.net me at ibotty.net
Mon Oct 22 18:39:57 CEST 2012


> Is there a nice simple way to stop Varnish rewriting X-Forwarded-For
> if it's already populated?

you should not unconditionally trust any http header. so the best way
might be to check for presence of the header and rewrite it unless the
client's ip is two if clauses should do just fine. (if it
does not work for you, i can get a snippet i once wrote. but that won't
be tomorrow.)


More information about the varnish-misc mailing list