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

From: Sébastien WENSKE <sebastien_at_wenske.fr>
Date: Tue, 24 Nov 2009 01:27:30 +0100

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.

Best regards,

Sébastien WENSKE



-----Message d'origine-----
De : Henrik Nordstrom [mailto:henrik_at_henriknordstrom.net]
Envoyé : mardi 24 novembre 2009 00:25
À : Sébastien WENSKE
Cc : squid-users_at_squid-cache.org
Objet : Re: [squid-users] squid 3.0 as reverse proxy and apache log at back-end

mån 2009-11-23 klockan 17:41 +0100 skrev Sébastien WENSKE:

> In my previous mail I explained that I'm using a squid reverse proxy
> with high bandwidth to cache my apache at home. There are connected by
> VPN, and I would know if it is possible to get original IP in my
> apache logs.

Yes. You need to configure Apache to log the X-Forwarded-For header sent
by Squid.

Regards
Henrik

Received on Tue Nov 24 2009 - 00:27:40 MST

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