Use Rack::Request#ip instead of REMOTE_ADDR header.