$realip_remote_addr выдает айпи прокси а не клиента
Андрей Василишин
a.vasilishin на kpi.ua
Сб Янв 23 22:45:36 UTC 2016
В конфиге прописано:
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