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

I just upgraded from apache2.2 to apache2.4, suddly Remote_Addr prints 127.1.1.0 instead of client ip. I have apache behaind nginx with the following settings:

                proxy_pass http://127.0.0.1:8080;
                proxy_redirect off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_connect_timeout 60;
                proxy_send_timeout 60;
                proxy_read_timeout 60;
share|improve this question

1 Answer 1

up vote 1 down vote accepted

If I've read your question correctly you have:

 internet -> nginx -> apache

If you want the Apache PHP/access.log/CGI environments to show the requesting (external) IP then you want to use mod_rpaf.

NOTE: If you've upgraded mod_rpaf recently you might find it doesn't work, due to this bug:

share|improve this answer
    
it always worked without this module prior to upgrade ... –  dvrecmfo Oct 11 '13 at 22:51
    
Are you sure? nginx will set the headers, but Apache won't know about them. If you have magic-code that checks the headers I could believe it, but most code just uses ENV{'REMOTE_ADDR'} and apache won't update that without mod_rpaf, or mod_headers. –  Steve Kemp Oct 11 '13 at 22:58
    
now we have an internal module called ` remoteip_module ` adding the following to httpd.conf fixed the problem. RemoteIPHeader X-Forwarded-For RemoteIPInternalProxy 127.0.0.0/24 –  dvrecmfo Oct 11 '13 at 23:01

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.