| From | Sent On | Attachments |
|---|---|---|
| rkmr...@gmail.com | Apr 19, 2009 9:15 am | |
| Michael Shadle | Apr 19, 2009 9:48 am | |
| rkmr...@gmail.com | Apr 19, 2009 1:43 pm | |
| Igor Sysoev | Apr 21, 2009 3:41 am | |
| Igor Sysoev | Apr 21, 2009 3:43 am | |
| Igor Sysoev | Apr 21, 2009 3:44 am | |
| Michael Shadle | Apr 21, 2009 8:30 am |
| Subject: | Re: http headers ip address | |
|---|---|---|
| From: | Igor Sysoev (is...@rambler-co.ru) | |
| Date: | Apr 21, 2009 3:41:27 am | |
| List: | ru.sysoev.nginx | |
On Sun, Apr 19, 2009 at 09:48:54AM -0700, Michael Shadle wrote:
make sure nginx has the "realip" module (nginx -V, look for --with-http_realip_module) - you could try it and run nginx -t to check the conf file to see if it's in your compile too.
Double check the header isn't a different case like X-FB-User-Remote-Addr or something (if you saw this in PHP it would be capitalized, but also prefixed with SERVER so maybe it is always capped)
nginx tests header name as case insentive string.
Lastly this is all you need. The first line is if you want to only trust that header from another proxy / load balancer / etc, which you probably do, so you can set it to the appropriate netmask.
set_real_ip_from 0.0.0.0/0; real_ip_header X-FB-USER-REMOTE-ADDR;
On Sun, Apr 19, 2009 at 9:16 AM, rkmr...@gmail.com <rkmr...@gmail.com> wrote:
hi i get the clients ip address in this http header: X-FB-USER-REMOTE-ADDR. how do i configure nginx so that this is set as the ip address of client for a fastcgi app?
thanks a lot!
-- Igor Sysoev http://sysoev.ru/en/





