Welcome! Log In Create A New Profile

Advanced

$realip_remote_addr выдает айпи прокси а не клиента

Андрей Василишин
January 23, 2016 05:56PM
В конфиге прописано:

real_ip_header X-Forwarded-For;
real_ip_recursive on;
set_real_ip_from 94.23.0.0/16;



proxy_set_header X-Real-IP $realip_remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


На бэкнде получаю в X_REAL_IP айпи прокси а не клиента:

[HTTP_X_REAL_IP] => 94.23.156.246
[HTTP_X_FORWARDED_FOR] => 176.104.49.220, 94.23.156.246
[REMOTE_ADDR] => 94.23.156.246

Кто виноват и что делать?

# nginx -V
nginx version: nginx/1.9.9
built by gcc 4.7.2 (Debian 4.7.2-5)
built with OpenSSL 1.0.1e 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid
--lock-path=/var/run/nginx.lock
--http-client-body-temp-path=/var/cache/nginx/client_temp
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=www-data
--group=www-data --with-http_ssl_module --with-http_realip_module
--with-http_addition_module --with-http_sub_module
--with-http_flv_module --with-http_mp4_module --with-http_geoip_module
--with-http_gunzip_module --with-http_gzip_static_module
--with-http_random_index_module --with-http_secure_link_module
--with-http_stub_status_module --with-http_auth_request_module
--with-threads --with-stream --with-stream_ssl_module
--with-http_slice_module --with-file-aio --with-http_v2_module
--with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4
-Wformat -Werror=format-security' --with-ld-opt=-Wl,-z,relro --with-ipv6
--with-debug

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

$realip_remote_addr выдает айпи прокси а не клиента

Андрей Василишин January 23, 2016 05:56PM

Re: $realip_remote_addr выдает айпи прокси а не клиента

Pavel V. January 24, 2016 03:34AM

Re: $realip_remote_addr выдает айпи прокси а не клиента

Андрей Василишин January 24, 2016 08:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 108
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready