Re: [squid-users] Want accel-mode squid to pass real IP to httpd

From: tookers <gareth_at_garethcoffey.com>
Date: Tue, 29 Sep 2009 12:41:22 -0700 (PDT)

Roger Cornelius wrote:
>
> Apologies for what is probably a newbie question. I've searched the
> squid directives, archives of this list, the net, etc., and haven't
> discovered, or didn't recognize, the answer.
>
> I'm using squid 2.7.STABLE6 in accelerator mode. I used the basic
> accelerator config example at:
>
> http://wiki.squid-cache.org/ConfigExamples/Reverse/BasicAccelerator
>
> The httpd, which is running on the same machine, sees all requests as
> coming from the IP of the machine squid/apache are running on. How do I
> configure squid so httpd sees the IP of the actual machine making the
> request so I can do acl in httpd?
>
> Thanks.
> --
> Roger Cornelius rac_at_tenzing.org
>
>

Hi There,

You can append the clients IP address to the request header you can set this
with 'forwarded_for on'.
In Apache, and even Squid, you can access the various elements in the
header.

Squid Example:-
acl BlockByHeader req_header X-Forwarded-For 192\.168\.1\.10
http_access deny BlockByHeader

Apache Example:-
RequestHeader set X-My-Header "something useful"

The log file in Apache can be changed to log the contents of X-Forwarded-For
header (which will contain the client IP) append this to your log file
format in httpd.conf
\"%{HTTP_X_FORWARDED_FOR}i\"

Hope that helps.

-- 
View this message in context: http://www.nabble.com/Want-accel-mode-squid-to-pass-real-IP-to-httpd-tp25667604p25669555.html
Sent from the Squid - Users mailing list archive at Nabble.com.
Received on Tue Sep 29 2009 - 19:41:24 MDT

This archive was generated by hypermail 2.2.0 : Thu Oct 01 2009 - 12:00:05 MDT