I'm running passenger on nginx and have a rails app server. I'm unable to get the user's remote IP.. how can I get the User's IP?
I use a nginx.conf.erb
which I can modify if needed..
The problem (I think) arises in google container engine which creates a load balancer in front of my app.. making request.remote_ip
only get a local kubernetes cluster-ip rather than the remote ip..
That should be pretty simple, infact you don't have to pass it from Nginx it always comes to rails as headers. You can access it as follows,
request.remote_ip