IP address forwarding using proxypass
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > IP address forwarding using proxypass




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    IP address forwarding using proxypass  
erdal@excite.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 07: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.






[ Post a follow-up to this message ]



    Re: IP address forwarding using proxypass  
Davide Bianchi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 12:49 PM

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





[ Post a follow-up to this message ]



    Re: IP address forwarding using proxypass  
Richard Antony Burton


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 12:49 PM

<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.







[ Post a follow-up to this message ]



    Re: IP address forwarding using proxypass  
erdal@excite.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-22-05 01:49 AM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:38 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register