My server doesn't have a public IP address, so I don't know how to get the real client's IP address.
This is my nginx's configuration:
location / {
proxy_pass http://domain1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
In my Rails app's controller both request.ip
and request.remote_ip
return my server's gateway address.
How can i get the real IP of client?
How to get X-Forwarded-For value from Rails request?