Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 10-02-2012, 12:05 PM   #1
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Rep: Reputation: 30
Question Apache reverse proxy, header issue

Hey all,

I am a Apache noob. With that out of the way, I'm trying to set up a relatively simple reverse proxy setup using Apache. I need it to do SSL termination before sending traffic for our website on. I actually have that part working.

The problem is, the system listening for the traffic behind the Apache system is only showing the IP address of the proxy, not of the actual client. I've been trying to get Apache to use the X-Forwaded-For header, but it just will not work for me. The listening system is already configured to look for the X-Forwarded-For header, and is working properly in the existing setup (which is hitting EoL soon and needs to be replaced, which more or less lead us here).

So, I first tried setting up Apache to use the RequestHeader set up, from an example I found through Google:

 RewriteEngine On
 RewriteRule ^(.*) - [E=CLIENT_IP:%{REMOTE_ADDR},L]
 RequestHeader set X-Forwarded-For %{CLIENT_IP}e
No change there, proxy IP still shows up to the backend system.

So, tried to simplify it:

 RequestHeader set X-Forwarded-For %{REMOTE_IP}e
Still nothing.

I found some references to a product called RPAF. Downloaded and set that up. Created a file called rpaf.conf in the /etc/httpd/conf.d folder to look like that:

LoadModule rpaf_module modules/
RPAFenable On
RPAFheader X-Forwarded-For
RPAFsethostname On
Still no workie.

So, I'm stuck. I don't know where else to check, and not being a programmer or web guy really, most of the information I find online is way over my head. Can anyone shed some light on how I can have Apache send along the original IP instead of it's own IP?

The system is a fully updated CentOS 6.3 64-bit system.

Old 10-03-2012, 02:49 PM   #2
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Original Poster
Rep: Reputation: 30
Replying just to add 1 important thing: Traffic that hits this Apache proxy system will already have the X-Forwarded-For header present. I put it in to test this morning, and had Apache set to read the X-Forwarded-For header, and it was doing so correctly. So, now the only issue is that I need it to preserve this header and send traffic along with it in tact so the system behind it can read it.

It sounds like this rpaf module should work, but so far, it's just not. Is there a way Apache can do it?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache reverse proxy chris9 Linux - Server 1 04-05-2012 09:41 AM
Reverse Proxy server issue maxy7710 Linux - Newbie 0 07-21-2008 03:33 AM
Apache reverse proxy noir911 Linux - Server 0 02-05-2008 09:21 PM
apache reverse proxy wildbob Linux - Networking 8 10-15-2003 01:16 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:23 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration