LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache reverse proxy, header issue (https://www.linuxquestions.org/questions/linux-server-73/apache-reverse-proxy-header-issue-4175430083/)

Phaethar 10-02-2012 11:05 AM

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:

Code:

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:

Code:

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:

Code:

LoadModule rpaf_module modules/mod_rpaf-2.0.so
RPAFenable On
RPAFheader X-Forwarded-For
RPAFsethostname On
RPAFproxy_ips 192.168.1.100

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.

Thanks!

Phaethar 10-03-2012 01:49 PM

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?


All times are GMT -5. The time now is 09:33 AM.