Correct IP in access log

Neil Sheth nsheth at gmail.com
Tue Sep 30 03:48:01 MSD 2008


Hello,

I'm in the process of upgrading my setup.  We're installing nginx on a
new server.  While we transition (and dns propogates), I will keep the
old nginx server running.  I'm going to route requests that hit the
old nginx server to my new nginx server, and then from there to the
new backend webservers.

Now, to keep my stats up to date, I need to capture the correct IP
address in the logs on the new nginx server.  On the old nginx server,
I have the following:

proxy_set_header   Host             $host;
proxy_set_header   X-Real-IP        $remote_addr;
proxy_set_header   X-Forwarded-For  $remote_addr;

Looking at the access log on the new server, I see all requests coming
from the same IP - that of the old server.  Any thoughts?

Thanks!





More information about the nginx mailing list