Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Sep 03, 2012 3:24 pm 
Offline
Senior Newbie

Joined: Mon Jan 16, 2012 12:04 pm
Posts: 11
Location: United States
Hi Guys,

Been scratching my head for a few hours now and wanted to see if anyone can help.

1) I have a load balancer with 6 servers in the back end.

2) The back end servers are Nginx and to get the real IP addresses of the visitors, all I have to do is the following in each Nginx install and I am able to get the real client IP address of each visitor.

set_real_ip_from 192.168.255.0/24; <-- to handle the load balancer IP
real_ip_header X-Forwarded-For;

3) Now I have installed Varnish in front of each Nginx running on 127.0.0.1 doing caching and for some reason now Nginx doesn't see the real client Ip addresses anymore coming from LoadBalancer --> Varnish --> Nginx

It's printing the following:

IP address:
192.168.255.9 <-- this should be the real client IP address and not the 192.168 (assuming the load balancer IP address is being printed)

More detailed host address:
192.168.255.9

Many thank if you can help.

Dave


Top
   
PostPosted: Tue Sep 04, 2012 1:51 pm 
Offline
Senior Newbie

Joined: Mon Jan 16, 2012 12:04 pm
Posts: 11
Location: United States
Anyone?


Top
   
PostPosted: Wed Sep 12, 2012 4:06 pm 
Offline
Sysop

Joined: Sat Nov 27, 2010 3:32 am
Posts: 180
Website: https://blog.timheckman.net/
Location: San Francisco, CA
Looks like mangling X_Forwarded_For may be a known issue in Varnish?

https://www.varnish-cache.org/forum/topic/110

Not too sure.

//heckman

_________________
'If debugging is the process of removing bugs, then programming must be the process of putting them in.' //Edsger Dijkstra
'Nothing is withheld from us which we have conceived to do.' | 'Do things that have never been done.' //Russell Kirsch


Top
   
PostPosted: Fri Sep 14, 2012 12:23 am 
Offline
Senior Newbie

Joined: Tue Aug 07, 2012 2:55 pm
Posts: 11
Try:

set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;

Works for me with Varnish in front of Nginx on the same server. No load balancer though.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group