Re: [squid-users] Squid load balancing access log

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 15 May 2012 23:30:16 +1200

On 15/05/2012 3:29 p.m., Ibrahim Lubis wrote:
> Squid guru,
>
> I do load balancing 2 centos server with ucarp and haproxy, with cache peering all squid server as sibling. I use squid as caching. The problem is every log line what i see in access log file is ip from squid cache not from user requested web access. Before i do load balancing,only one squid box, in access log file i see ip user requested web access.
>
> Thx

Your understanding of the logged information is incorrect. What your
server is logging is the *client* it received the request from. client
and user are two different things. Squid is the servers client.

Previously you had some configuration setup to pass Squids client IP
through to the web server and log that instead of teh Web servers client
(Squid IP).
Squid with the "forwarded_for on" directive updates the X-Forwarded-For
header with its clients IP. The web server needs to process that header
in order to retrieve the furthest downstream IP it can trust.

NP: the client "IP" produced by this may be one IP or a whole list of
addresses, possibly the word "unknown", and increasingly likely these
days to be a different IPv4/6 version to teh web server. Be sure your
server can handle any of those cases.

Amos
Received on Tue May 15 2012 - 11:30:22 MDT

This archive was generated by hypermail 2.2.0 : Tue May 15 2012 - 12:00:04 MDT