I have two rails webapps, I have configured one webapp to respond to multiple domains. I have done this by making the corresponding server block in nginx as the default.
Now, I want to make even the other webapp process requests for custom multiple domains, Is there a way to do this using a machine with a single IP address? (I know that I can add an additional IP address and make the other webapp listen on this, but my server is on EC2 so I can't add more IPs.)
Both these webapps know which domains they are supposed to respond to, and there are a lot of domains. Also, the domains which these webapps need to respond to, will be changing. So I can't hardcode them in the nginx config. My server has Ubuntu 10.04.
I've researched a bit into this and I think HAProxy may be able to do this kind of routing. Is it possible for HAProxy ACLs to access something like redis to find the destination of an http request?