سؤال

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!

هل كانت مفيدة؟

المحلول

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;
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top