|
Home > Archive > Apache Server configuration support > September 2005 > IP address forwarding using proxypass
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
IP address forwarding using proxypass
|
|
| erdal@excite.com 2005-09-21, 2:51 am |
| Is there a way of forwarding the IP address that the request has come
from?
I have a setup where I am using Apache and IIS on the same box.
In my httpd.conf I have a ProxyPass and ProxyReverse directive as
follows:
ProxyPass /dummy/ http://192.168.1.0:8080/dummy/
ProxyPassReverse /dummy/ http://192.168.1.0:8080/dummy/
I am using Apache 1.3.27 for Windows, IIS 6.0
Apache does the ProxyPass, but, attaches the IP address of the server
to the request, not that of the client.
As a result, in my log, all I'm ending up with is the server's IP
address, not the originating (client) IP address.
E.g. IIS Log (generated via .aspx):
ActionA, 192.168.1.0, 01/09/2005 15:33:02
ActionB, 192.168.1.0, 01/09/2005 15:33:03
ActionC, 192.168.1.0, 01/09/2005 15:33:07
ActionD, 192.168.1.0, 01/09/2005 15:33:34
ActionE, 192.168.1.0, 01/09/2005 15:33:40
The problem is, I wish to log the requests on IIS in my aspx pages,
doing a Request.UserHostAddress.ToString(); which results in the
server's ip address.
I've also tried: Request.UrlReferrer.Host.ToString(); which returns
null, probably meaning that apache is not putting a value in the
referrer portion of the forwarded request.
Is there a way to tell Apache to do this ProxyPass, but, somehow attach
the original request's IP address, not that of its own?
Thanks for any help anyone can offer.
| |
| Davide Bianchi 2005-09-21, 7:49 am |
| On 2005-09-21, erdal@excite.com <erdal@excite.com> wrote:
> Is there a way of forwarding the IP address that the request has come
> from?
AFAIK not with mod_proxy. Maybe you need a fully-fledged proxy for that.
> Apache does the ProxyPass, but, attaches the IP address of the server
> to the request, not that of the client.
Yes, that's the pourpose of a proxy...
Davide
--
"Nobody will ever need more than 640k RAM!" -- Bill Gates, 1981
"Windows 95 needs at least 8 MB RAM." -- Bill Gates, 1996
"Nobody will ever need Windows 95." -- logical conclusion
| |
| Richard Antony Burton 2005-09-21, 7:49 am |
| <erdal@excite.com> wrote in message
news:1127288540.941544.277720@g44g2000cwa.googlegroups.com...
> Is there a way of forwarding the IP address that the request has come
> from?
This was asked quite recently, see "Aliases and Redirects" on the 25th
August. I suggested a way to insert an extra header into the request to the
backend server, and use some custom logging on IIS to log that IP from the
header instead of the usual client one. It turns out (I didn't know) that
apache inserts extra headers into the request anyway so you can just use
those.
http://groups.google.co.uk/group/al...ts&rnum=1&hl=en
Richard.
| |
| erdal@excite.com 2005-09-21, 8:49 pm |
| Thanks very much, that was a great help.
I've found that the IP address of the client was being included in the
header items below, which I can use to find out where the original
request came from;
X-Forwarded-For
X-Forwarded-Host
X-Forwarded-Server
|
|
|
|
|