I would like to use Nginx upstreams to balance two instances of an application, one of them is on an EC2 server and the other on Heroku.
The problem is, when I put the app.herokuapp.com in the upstream directive, it resolves to the ip address, and the requests are sent to the ip address, but heroku uses the host to identify the application, so it doesn't work.
I'm stuck on this, what could I do?
Update: My app uses host too, so I think I am stuck on this. As I can't change Heroku, I guess I will have to add a header with the original request Host to be used by my application and keep the Host as default, so Heroku will find my application