LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-02-2012, 12:05 PM   #1
Phaethar
Member
 
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:

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!
 
Old 10-03-2012, 02:49 PM   #2
Phaethar
Member
 
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?
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:58 AM.

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