Yes you have to use $http_x_forwarded_for for it.<br><br><div class="gmail_quote">On Thu, Mar 5, 2009 at 9:59 AM, Mohammad Kolahdouzan <span dir="ltr">&lt;<a href="mailto:mohammad_ysm@yahoo.com">mohammad_ysm@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div><br>I monitored the HTTP headers of the requests that are forwarded to Nginx by the load balancer using tcpdump, and I can clearly see that the remote IP is added to the headers as a new header &quot;REMOTE ADDR:&quot;, still use $http_x_forwarded_for it?<br>
<br>Thanks,<br>-M<br><br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1">
<b><span style="font-weight: bold;">From:</span></b> Abhishek Singh &lt;<a href="mailto:abhishek.rhce@gmail.com" target="_blank">abhishek.rhce@gmail.com</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> <a href="mailto:nginx@sysoev.ru" target="_blank">nginx@sysoev.ru</a><br>
<b><span style="font-weight: bold;">Sent:</span></b> Wednesday, March 4, 2009 7:06:18 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: nginx not
 setting REMOTE_ADDR properly?<br></font><div><div><span id="q_11fd4fd9dad8ae2a_1" class="h4">- Show quoted text -</span></div><div class="h5"><br>
Use &quot;$http_x_forwarded_for&quot; to log client real ip address.<br><br><div class="gmail_quote">On Thu, Mar 5, 2009 at 8:22 AM, Mohammad Kolahdouzan <span dir="ltr">&lt;<a rel="nofollow" href="mailto:mohammad_ysm@yahoo.com" target="_blank">mohammad_ysm@yahoo.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br>My nginx is getting requests through a (NetScaler) load balancer, and $remote_addr is returning the load balancer&#39;s IP and not the real user&#39;s IP (which the load balancer sets as REMOTE_ADDR in the header). Any other attribute I should use to get the real user&#39;s IP?<br>

<br>-M<br><br></div><br>

      </div></blockquote></div><br><br clear="all"><br>
</div></div></div></div></div><br>

      </div></blockquote></div><br><br clear="all"><br>-- <br>Abhishek Kumar Singh<br>ibibo web pvt. ltd.<br><br><a href="http://www.ibibo.com">www.ibibo.com</a><br><br>Mob: +91-9810848283<br>