Problem solved!
Just change nginx config!
open
/etc/nginx/nginx.conf
And add the following lines to your http{} statement
set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;
سؤال
I used nginx in front and apache for backend, also varnish for caching
now, IP of all of the visitors return as 127.0.0.1
How can I config my server to return real ip of customers?
I did test many ways but none of them correct and work for me!
المحلول
Just change nginx config!
open
/etc/nginx/nginx.conf
And add the following lines to your http{} statement
set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;