I am quite new to Nginx, and it seems all so confusing. I have my server setup perfectly, but the problem is, since my server is protected using a HTTP proxy; instead of log
The correct way of doing this is by setting the real_ip_header configuration in nginx.
real_ip_header
Example with trusted HTTP proxy IP:
set_real_ip_from 127.0.0.1/32; real_ip_header X-Forwarded-For;
This way, the $_SERVER['REMOTE_ADDR'] will be correctly filled up in PHP fastcgi.
Documentation link - nginx.org