﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1127	set_real_ip_from not working in 1.10.x	exobuzz@…		"nginx version: 

Linux 4.7.0-0.bpo.1-amd64 #1 SMP Debian 4.7.8-1~bpo8+1 (2016-10-19) x86_64 GNU/Linux

Upgraded from 1.9.10 to 1.10.2 and set_real_ip_from is no longer working ( running behind varnish)

Other users are having the same issue - https://github.com/gplessis/dotdeb-nginx/issues/87 (Using dotdeb packages)

real_ip nginx config
{{{
set_real_ip_from IP_OF_SERVER;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
}}}
This works fine on 1.9.10 and in the logs are the ip of the client. However when using 1.10.2 the IP_OF_SERVER is shown instead

setting the log format to

{{{
        log_format timed_combined '$remote_addr - $remote_user [$time_local] '
            '""$request"" $status $body_bytes_sent '
            '""$http_referer"" ""$http_user_agent"" '
            'http_x_forwarded_for = $http_x_forwarded_for,
real_ip_remote_addr = $realip_remote_addr';
}}}

gives:


IP_OF_SERVER - - [14/Nov/2016:17:49:16 +0000] ""GET /nginx_test HTTP/1.1"" 404 9553 ""-"" ""Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0"" http_x_forwarded_for = IP_OF_CLIENT, IP_OF_CLIENT, real_ip_remote_addr = IP_OF_SERVER


IP_OF_SERVER = IP of the webserver
IP_OF_CLIENT = IP of my client which should be used for $remote_addr

switching back to 1.9.10 and all is fine again with IP_OF_CLIENT showing in the log for $remote_addr

"	defect	closed	minor		nginx-module	1.10.x	duplicate			Linux myserver 4.7.0-0.bpo.1-amd64 #1 SMP Debian 4.7.8-1~bpo8+1 (2016-10-19) x86_64 GNU/Linux	"nginx version: nginx/1.10.2
built with OpenSSL 1.0.1t  3 May 2016 (running with OpenSSL 1.0.2j  26 Sep 2016)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-file-aio --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_secure_link_module --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/usr/src/builddir/debian/modules/nginx-auth-pam --add-module=/usr/src/builddir/debian/modules/nginx-dav-ext-module --add-module=/usr/src/builddir/debian/modules/nginx-echo --add-module=/usr/src/builddir/debian/modules/nginx-upstream-fair --add-module=/usr/src/builddir/debian/modules/ngx_http_substitutions_filter_module --add-module=/usr/src/builddir/debian/modules/nginx-cache-purge --add-module=/usr/src/builddir/debian/modules/ngx_http_pinba_module --add-module=/usr/src/builddir/debian/modules/nginx-x-rid-header --with-ld-opt=-lossp-uuid"
