Welcome! Log In Create A New Profile

Advanced

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

Piotr Gasidło
June 07, 2009 08:44AM
2009/6/6 <mates007@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
Subject Author Posted

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

mates007@centrum.cz June 06, 2009 04:07PM

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

Piotr Gasidło June 07, 2009 08:44AM

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

mates007@centrum.cz June 07, 2009 12:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 199
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready