RE: [squid-users] squid 3.0 as reverse proxy and apache log at back-end

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 24 Nov 2009 13:39:25 +1300

On Tue, 24 Nov 2009 01:27:30 +0100, Sébastien WENSKE <sebastien_at_wenske.fr>
wrote:
> Many thanks Henrik!
>
> I have add these two directive in apache2.conf:
>
> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" reverse_proxy
> and
> SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" is-forwarder
>
> And in my vhost:
>
> CustomLog /var/log/apache2/blog.log reverse_proxy
env=is-forwarder
> CustomLog /var/log/apache2/blog.log combined env=!is-forwarder
>
> This works pretty fine.

Careful though with XFF. I'd put quotes around it too.
 As ISPs move into layering NAT and proxy gateways, or if you extend your
own CDN vertically, you can expect it to contain more than one IP with
maybe some whitespace between them.

Amos
Received on Tue Nov 24 2009 - 00:39:30 MST

This archive was generated by hypermail 2.2.0 : Tue Nov 24 2009 - 12:00:04 MST