Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;


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

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 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
up vote 10 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>


<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:… – thor Oct 5 '12 at 12:59
For anyone coming to this post after upgrading to 14.04 this fix will no longer apply; instead you will want to use mod_remoteip instead of mod_rpaf. – Stefan Magnuson Sep 30 '14 at 13:05

Your Answer


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.