<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div><br>I tried using $http_x_forwarded_for and what is being logged is "-" and not the remote user's IP, even though I verified again (using tcpdump) and the remote user's IP is right after "REMOTE_ADDR :" in http headers.<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 face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Abhishek Singh &lt;abhishek.rhce@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> nginx@sysoev.ru<br><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, March 4, 2009 8:38:49 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: nginx not setting REMOTE_ADDR properly?<br></font><br>
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 rel="nofollow" ymailto="mailto:mohammad_ysm@yahoo.com" target="_blank" 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 "REMOTE ADDR:", 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 face="Tahoma" size="2"><hr size="1">
<b><span style="font-weight: bold;">From:</span></b> Abhishek Singh &lt;<a rel="nofollow" ymailto="mailto:abhishek.rhce@gmail.com" target="_blank" href="mailto:abhishek.rhce@gmail.com">abhishek.rhce@gmail.com</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> <a rel="nofollow" ymailto="mailto:nginx@sysoev.ru" target="_blank" href="mailto:nginx@sysoev.ru">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 "$http_x_forwarded_for" 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" ymailto="mailto:mohammad_ysm@yahoo.com" target="_blank" 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;"><br>My nginx is getting requests through a (NetScaler) load balancer, and $remote_addr is returning the load balancer's IP and not the real user's IP (which the load balancer sets as REMOTE_ADDR in the header). Any other attribute I should use to get the real user'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 rel="nofollow" target="_blank" href="http://www.ibibo.com">www.ibibo.com</a><br><br>Mob: +91-9810848283<br>
</div></div></div><br>

      </body></html>