atom feed6 messages in ru.sysoev.nginxRe: Keep client ip address
FromSent OnAttachments
Igor SysoevDec 30, 2006 10:25 am 
Aleksandar LazicDec 30, 2006 10:40 am 
Igor SysoevDec 30, 2006 10:44 am 
Guillermo Fernandez CastellanosDec 30, 2006 12:57 pm 
Igor SysoevDec 30, 2006 1:06 pm 
Aleksandar LazicDec 30, 2006 1:09 pm 
Subject:Re: Keep client ip address
From:Guillermo Fernandez Castellanos (guil@public.gmane.org)
Date:Dec 30, 2006 12:57:21 pm
List:ru.sysoev.nginx

Hi,

Thanks Aleksandar and Igor for your answers.

Eventually I've removed all references to real_ip, added those lines: proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; and defined a new log format for my apache server with %{X-Forwarded-For}i

And it works like a charm.

I don't know if changing the log format is the cleanest solution, but for my simple setup mod_rpaf is a bit overkill and the log change just works (kiss).

Concerning the compilation options, I have to admit I've used an Ubuntu precompiled package at http://deb.wapper.ru/nginx/. Hopefully nginx will quickly be integrated into Ubuntu, you definitively deserve it (it's in feisty, a bit far yet...).

I've been surprised by how quickly I got a (correct and helpful) answer. Again, thanks a lot.

Happy new year,

Guille

On 12/30/06, Aleksandar Lazic <al-n@public.gmane.org> wrote:

Hi,

On Sam 30.12.2006 21:26, Igor Sysoev wrote:

I have the following system: [snipp] Is what i want to do possible? Does my approach make sense?

nginx passes a client address in X-Real-IP or X-Forwarded-For using

proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

On Apache side you need to set mod_rpaf ( http://stderr.net/apache/rpaf/ )

or you change %h with %{X-Real-IP}i or with %{X-Forwarded-For}i

http://httpd.apache.org/docs/2.2/mod/mod_log_config.html

On nginx side you do not need

set_real_ip_from 192.168.1.0/24; real_ip_header X-Real-IP;

They do the same thing as mod_rapf for Apache.

I think the realip_module isn't build by default, isn't it?!

If not then don't forget to give --with-http_realip_module option to ./configure ;-)