How to get remote hostname from behind mongrel cluster in rails?

Using request.env['REMOTE_HOST'] worked with WEBrick, but returns
blank when running behind mongrel cluster.
For IP Address, I am able to use request.remote_ip.
Thank you.

I haven’t done this specifically, but I think you would need to specifically forward certain header(s) from your front end proxy — maybe something like X-Forwarded-Server.

Thanks. Does anyone know how I can do this?