Node.js - subdomain per user + user domain resolution

Using Node.js / Express I have a REST API with several isomorphic / universal applications that consume this API.

I would like users to have their own subdomain, and this happens dynamically when they register.

From what I explored, the best way to do this is to point a wildcard entry to isomorphic / universal application servers and have some logic in there that interprets requests looking for a subdomain and serves up the relevant pages. This I suggest that you need to sit in front of the application and execute for each server request.

Would this be the best way to approach this problem? Is there an alternative way?

Will there be any potential scalability issues?

Then I would like to allow users to have their own domain. Tumblr and other services provide a similar feature where they allow you to specify a CNAME record in the user's subdomain. I was not able to find a lot of information on how this works.

What is the best way to allow users to use their own domain for their domain in the application?

+4
source share
1 answer

Would this be the best way to approach this problem? Is there an alternative way?

Will there be any potential scalability issues?

, DNS, - , - , . DNS API, Route 53, . , . , , DNS , ( 53 , 500 AWS).

?

( HTTP-). , , ( ); , , (). CNAME - ( , ).

HTTPS, , SNI. , , PEM , - Lets Encrypt api webroot.

+3

All Articles