Welcome! Log In Create A New Profile

Advanced

proxy_pass to backend (varnish): delivered ip?

January 30, 2013 10:33AM
Hey,
maybe the solution is really simple, but i can't find it.

nginx (1.2.1) handles ssl and proxies the traffic to the backend (varnish, which also handles http):

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:80;
}

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.

For testing reasons i switched the ip to the lan ip (which varnish also listens to):

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.0.1:80;
}

And now the requests in varnish log look like:

192.168.0.1 - - [30/Jan/2013:16:16:25 +0100] .........

Well, where's the error? How can it be done that varnish receives the external ip (smth. like 84.156.23.145) from nginx? I suppose it's quite simple but i can't see it... :-/
SubjectAuthorPosted

proxy_pass to backend (varnish): delivered ip?

reviriiJanuary 30, 2013 10:33AM

Re: proxy_pass to backend (varnish): delivered ip?

Francis DalyJanuary 30, 2013 10:54AM

Re: proxy_pass to backend (varnish): delivered ip?

reviriiJanuary 30, 2013 11:13AM

Re: proxy_pass to backend (varnish): delivered ip?

Francis DalyJanuary 30, 2013 11:22AM

Re: proxy_pass to backend (varnish): delivered ip?

reviriiJanuary 31, 2013 02:13AM

Re: proxy_pass to backend (varnish): delivered ip?

Francis DalyJanuary 31, 2013 06:48AM

Re: proxy_pass to backend (varnish): delivered ip?

AxelJanuary 30, 2013 11:24AM

Re: proxy_pass to backend (varnish): delivered ip?

reviriiJanuary 31, 2013 01:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 87
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready