On Tue, 24 Nov 2009 01:27:30 +0100, Sébastien WENSKE <[email protected]>
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

Reply via email to