Welcome! Log In Create A New Profile


remote_addr not set using x-real-ip

ron ramos
January 26, 2015 08:32AM
Hi All,

I would just like to check what mistake i did on implementing real-ip
Im using nginx 1.6.2 with real_ip_module enabled:

nginx -V
nginx version: nginx/1.6.2
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Wformat-security
-Werror=format-security -D_FORTIFY_SOURCE=2'
--with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro'
--prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock
--pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit
--with-ipv6 --with-http_ssl_module --with-http_stub_status_module*

i have the following entry on nginx.conf

real_ip_header X-Forwarded-For;
real_ip_recursive on;

and i added the following to format my logs:

log_format custom_logs '"$geoip_country_code" - "$http_x_forwarded_for" -
"$remote_addr" -

in which i get this results:

"-" - "," - "" -
"-" - "," - ""
"-" - "," - ""

the first column does not match any country code on the geoip database
since it is detected as the private IP ( in which this country's ISP seems
to have proxy sending the private IP )

if using real_ip modules i should be seeing the source IP on $remote_addr
in the logs, is that correct? please advise if anyone has encountered the
same issue. thank you in advanced.

nginx mailing list
Subject Author Posted

remote_addr not set using x-real-ip

ron ramos January 26, 2015 08:32AM

Re: remote_addr not set using x-real-ip

Francis Daly January 26, 2015 03:12PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 92
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready