Hey guys!
I currently have nginx forwarding my ajax requests to my Django project.
I would like to grab the client's IP address in my Django code. In the past, I did this by simply calling "request.META['REMOTE_ADDR']", but this doesn't seem to work anymore.
After doing a little research, it seemed that I needed to add the following to my config file:
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
But I still can't seem to grab the user's IP address! Am I forgetting something? :(
Thanks!