I am having this problem to find unique visitors to my site. The site is deployed on AWS cloud. The first hit goes to load balancer which routes to varnish cache (type of reverse proxy) and which inturn routes to apache web server. I have the below config inside my apache conf file:
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{forensic-id}n\"" varnishcombined
CustomLog logs/access_log varnishcombined
inside my varnish file I have following: sub vcl_recv {
unset req.http.X-Forwarded-For;
set req.http.X-Forwarded-For = client.ip;
When I check my access log, I see that all requests have the load balancer IP rather than the actual IP of the client from where request has come. nfact it is the ip of the aws load balancer.
If i remove any one that is either varnish or load balancer my access log has correct entries capturing the client IP addresses.
Has anybody faced this situation?
Manguesh