proxy_pass to backend (varnish): delivered ip?
francis at daoine.org
Wed Jan 30 15:53:17 UTC 2013
On Wed, Jan 30, 2013 at 10:33:25AM -0500, revirii wrote:
> The requests are sent to varnish, in the varnish logs i see them, they look
> like (shortened):
> 127.0.0.1 - - [30/Jan/2013:16:06:54 +0100] .........
> So varnish receives 127.0.0.1 from nginx, but i want varnish to receive the
> external ip.
The connection to varnish comes from the address 127.0.0.1. That's what
it logs here.
> And now the requests in varnish log look like:
> 192.168.0.1 - - [30/Jan/2013:16:16:25 +0100] .........
The connection to varnish comes from the address 192.168.0.1. That's
what it logs here.
> Well, where's the error? How can it be done that varnish receives the
> external ip (smth. like 126.96.36.199) from nginx? I suppose it's quite
> simple but i can't see it... :-/
varnish could see the "true" remote_addr in the X-Real-IP: http header
that you send, if it looked there.
If you want varnish to log the contents of that header, or to log that
instead of what it sees as the connecting ip address, you'll be better
off to ask in a place where people know varnish.
Francis Daly francis at daoine.org
More information about the nginx