Closed xdmx closed 3 years ago
You may be able to get it via the x-forwarded-for
header but I'm actually feeling more like we shouldn't store ips as a default anyway. If users, like you, want to store them, it's fairly easy to either monkey patch the included SessionsController or copy and modify it to their needs.
There is good discussion points around this here - https://stackoverflow.com/questions/10997005/whats-the-difference-between-request-remote-ip-and-request-ip-in-rails
If the app is behind nginx, it shows up as 127.0.0.1 .
Would be cleaner to provide a lambda so that developer can pass in a block like the rest of the initializers?
Have opened a feature request issue and will close this.
I'm trying out the gem with an application that runs behind on cloudflare -> nginx -> puma and checking the
remote_addr
of all visits it's always127.0.0.1
, instead of the real ip (the app is live and requests were real / over the internet). From reading around it seems that when there is a proxy in between (like cloudflare, nginx, etc)remote_ip
should be used instead.Do you have any hints about this? Should it be changed in the gem itself or is it more "app based" (and thus override that setter)?