Getting a full url of a current request in Rack in production

I have a Roda/Rack app

"request.url" on localhost returns a full url of a current route which is "localhost:9292/something". It's good and is what I need.

On production I'll my deploy my app behind nginx. However, the "request.url" will still return "localhost:9292/something" because the app will run the same way as it does on localhost because it'll be running behind nginx. Meaning, from the point of view of the app, it's still running on localhost. Hence the "request.url" will contain the "localhost" part instead of the name of my domain.

How can I fix this and get around it?