<div dir="ltr">I've been struggling all day with this, I'm missing something, hoping someone can point out what I'm doing wrong w/ the realip module:<div><br></div><div>nginx.conf:</div><div>...</div><div><div>  log_format xyz '$remote_addr - $remote_user [$time_iso8601] '</div><div>                    '"$request" $status $body_bytes_sent '</div><div>                    '"$http_referer" "$http_user_agent" "$http_x_forwarded_for" $http_x_real_ip';</div><div><br></div><div>  access_log  /var/log/nginx/access.log xyz;</div></div><div>...</div><div><div>  real_ip_header X-Forwarded-For;</div><div>  real_ip_recursive on;</div></div><div>  set_real_ip_from <a href="http://172.0.0.0/8">172.0.0.0/8</a>;<br></div><div>...</div><div><br></div><div><br></div><div>Test command I'm running:</div><div>curl -v -v -v -H "Host: <a href="http://www.test.com">www.test.com</a>" -H "X-Forwarded-For: 9.1.2.3, 172.16.9.92" <a href="http://127.0.0.1/cheese">http://127.0.0.1/cheese</a><br></div><div><br></div><div><br></div><div>What I see in the error log:</div><div>127.0.0.1 - - [2017-08-28T14:20:38-04:00] "GET /cheese HTTP/1.1" 502 166 "-" "curl/7.29.0" "9.1.2.3, 172.16.9.92" -<br></div><div><br></div><div><br></div><div>I'm expecting that either $remote_addr or $http_x_real_ip be 9.1.2.3, but the former is 127.0.0.1 and the latter is null.</div><div><br></div><div>I've tried two versions of Nginx including the latest, so pretty sure its an issue with my config. The config test is successful, no errors in the error log (level debug), the 502 status code is expected and shouldn't impact the realip module.</div><div><br></div></div>