logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: tell apache to use X-FORWARD-FOR instead of real IP
Author
mordret



Joined: 11 Jul 2008
Posts: 3

PostPosted: Thu 26 Mar '09 13:15    Post subject: tell apache to use X-FORWARD-FOR instead of real IP Reply with quote

hi,

I have to following problem:
my machine running apache is going to be moved behind a proxy.
The users IP is forwarded by X-FORWARD-FOR.
In apache I used to have an acl list consisting of hundreds IP ranges that I allowed.
What I would like to do is to tell apache to replace the real IP (the one from the proxy) with the one in X-FORWARD-FOR so that I can use the existing way of allowing users.
Any idea would be highliy appreciated.

J

PS: I know I could do the check in the application reading the X-FORWARD-FOR in e.g. ruby and reject, yet I don't really want to change much in my configuration of the system
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7407
Location: EU, Germany, Next to Hamburg

PostPosted: Tue 07 Apr '09 9:49    Post subject: Reply with quote

You could change the log file format

Code:

LogFormat "%h %l %u %t \"%r\" %>s %b" common


to

Code:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{X-Forwarded-For}i\"" common
Back to top


Reply to topic   Topic: tell apache to use X-FORWARD-FOR instead of real IP View previous topic :: View next topic
Post new topic   Forum Index -> Apache