I am developing an application (RoR + Heroku) that allows users to create their own websites either using my subdomain (pagename.myapp.com) or using my own domain (pagename.com). An important point of this is that this option is the key to my business: subdomains are free plans, and user domains are paid. Therefore, I have a table where I store the user domains of each user and check if this page is active (exists and paid a quota).
To do this, I need to give users the opportunity to point their domain to my servers. All we know is that Heroku does not recommend using DNS A-Records .
I would also like to distract this feature as much as possible in order to switch my infrastructure (Heroku to AWS) in the future without asking all my users to change their DNS zone. Taking this into account, I believe that the best option would be to start something like an EC2 proxy server (using AWS Elastic IP), which gives me the right to own this IP address. This proxy, I think, should redirect to proxy.myapp.com, and I would allow the request at the application level.
Due to the fact that I did not find clear information about this, I am not sure whether this hypothesis is the best solution and how to configure a proxy server (which type of proxy uses? Nginx is possible?).
Said that I would like to ask for recommendations / best practices to address this "common" function.
thanks
source share