解決

remote_ip は、 ActionDispatch::RemoteIp で判定したIPを優先する。

その判定がない場合は、 ip メソッドを使用する。

ruby - What’s the difference between request.remote_ip and request.ip in Rails? - Stack Overflow