I have an API with Goliath gem (ruby) and I want to get the ip of the movile which is calling to my API. The case is, env['REMOTE_ADDR']
always give me 127.0.0.1
when some device is calling me. It shoud be the ip from the mobile is calling me, right?
Any help please?
Thanks in advance!
The problem was with proxying through Nginx. I had to change the Nginx proxy configuration as follows.
The important thing is: The real IP is in the
X-Real-IP
parameter. So you have to access it as: