nginx1->nginx2->apache and wrong IP address in nginx2 access log

mates007 at centrum.cz mates007 at centrum.cz
Sun Jun 7 20:10:40 MSD 2009


Thanks a lot,
that worked for me.
Martin

______________________________________________________________
> Od: quaker at barbara.eu.org
> Komu: nginx at sysoev.ru
> Datum: 07.06.2009 15:42
> Předmět: Re: nginx1->nginx2->apache and wrong IP address in nginx2 access log
>
>2009/6/6  <mates007 at centrum.cz>:
>> Hello,
>> I have a machine 1 with nginx as a proxy before apache, and machine2 with nginx as a proxy before apache. I am moving websites from machine1 to machine2. Because DNS still points to machine1, I need to pass traffic from machone1 to machine2 for a while.
>> Everything is working fine, but in machine2 nginx log I have IP of machine1 as clients address. This is a problem because of awstats.
>>
>> Can please anybody advise me that I have wrong in my configuration?
>
>Have a look at http://wiki.nginx.org/NginxHttpRealIpModule and
>configure it on machine2:
>
>#v+
>set_real_ip_from   outgoing_ip_address_of_machine1;
>real_ip_header     X-Real-IP;
>#v-
>
>-- 
>Piotr Gasidło
>
>






More information about the nginx mailing list