<div>Hi Michael,</div>
<div>Thanks a lot for this.</div>
<div> </div>
<div>I want to do this only if this header is available. IF it is not available, it should the client ip should be the default one.</div>
<div>how can i do that?</div>
<div> </div>
<div>thanks again<br><br></div>
<div class="gmail_quote">On Sun, Apr 19, 2009 at 9:48 AM, Michael Shadle <span dir="ltr">&lt;<a href="mailto:mike503@gmail.com">mike503@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">make sure nginx has the &quot;realip&quot; module (nginx -V, look for<br>--with-http_realip_module) - you could try it and run nginx -t to<br>
check the conf file to see if it&#39;s in your compile too.<br><br>Double check the header isn&#39;t a different case like<br>X-FB-User-Remote-Addr or something (if you saw this in PHP it would be<br>capitalized, but also prefixed with SERVER so maybe it is always<br>
capped)<br><br>Lastly this is all you need. The first line is if you want to only<br>trust that header from another proxy / load balancer / etc, which you<br>probably do, so you can set it to the appropriate netmask.<br><br>
set_real_ip_from <a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a>;<br>real_ip_header X-FB-USER-REMOTE-ADDR;<br>
<div>
<div></div>
<div class="h5"><br><br><br>On Sun, Apr 19, 2009 at 9:16 AM, <a href="mailto:rkmr.em@gmail.com">rkmr.em@gmail.com</a> &lt;<a href="mailto:rkmr.em@gmail.com">rkmr.em@gmail.com</a>&gt; wrote:<br>&gt; hi<br>&gt; i get the clients ip address in this http header: X-FB-USER-REMOTE-ADDR. how<br>
&gt; do i configure nginx so that this is set as the ip address of client for a<br>&gt; fastcgi app?<br>&gt;<br>&gt; thanks a lot!<br>&gt;<br>&gt;<br><br></div></div></blockquote></div><br>