Redirect_to behind firewall

Hello! I have the following problem:
rails app runs on linux server with ip
the ip is not accesible from the internet
when you connect to app url filewall is configed such that it takes
incomming connections on port 80 for that url and forwards them to
internal-url:8080
so the firewall does the forwarding from
http://public_app_url:80 -> http://internal_ip:8080/

But when I use redirect_to method it redirects to the http://internal_ip
as host so I get the error.

Is there any solution for this problem?

Thanks,
Dmitry