Get the real IP address of client with Rails and Nginx?
Rails was supposed to be doing it automatically for us, but it seems to be broken with current 3.x
I'm using this:
def ip() request.env['HTTP_X_FORWARDED_FOR'] || request.remote_ip end
You should get the header value X-forwarded-for