Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running an Nginx front-end for static files, and proxying to an Apache backend for PHP and Passenger, using Apache's mod_rpaf to set the correct remote IP address on the backend. Everything worked fine until I upgraded to Ubuntu 12.04 (Precise). Now Apache reports all connections coming from 127.0.0.1.

Here's the relevant configuration. Nothing here changed with the upgrade.

Nginx:

proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;

mod_rpaf:

<IfModule mod_rpaf.c>
    RPAFenable On
    RPAFsethostname On
    RPAFproxy_ips 127.0.0.1 ::1
    RPAFheader X-Forwarded-For
</IfModule>

I'm using %{X-Forwarded-For}i in my Apache LogFormat directive and the access logs are showing the correct remote address, so I know Nginx is passing the address along properly.

In a phpinfo() test, HTTP_X_FORWARDED_FOR is showing the correct remote address, but REMOTE_ADDR is 127.0.0.1. This is reflected in PHP applications as well, such as WordPress comments.

I've tried switching Nginx and mod_rpaf to X-Real-IP with no effect.

Did something change that I missed?

Relevant version info, everything installed from the Ubuntu repository:

Nginx 1.1.19
Apache 2.2.22
mod_rpaf 0.6

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Just been dealing with this myself. There was an Ubuntu bug confirmed on Friday. You can get things working again by changing:

<IfModule mod_rpaf.c>

to

<IfModule mod_rpaf-2.0.c>

in /etc/apache2/mods-available/rpaf.conf

share|improve this answer
    
Fantastic, that did the trick. Thanks! –  Kenn May 29 '12 at 3:21
    
I had exactly the same problem after upgrade to 12.04 and lost half a day on the issue before finding this post. Thank you! –  Kouber Saparev Aug 7 '12 at 21:20
    
And bug itself, for completeness: bugs.launchpad.net/ubuntu/+source/libapache2-mod-rpaf/+bug/… –  thor Oct 5 '12 at 12:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.