I have a NodeJS application. I want to create a different instance of this application for each of my clients. My initial thoughts were to have each instance in a different port, and then launch a Node instance listening to those ports:
Client 1: http://client1.myapp:81 (an instance of my Node app listening port 81)
Client 2: http://client2.myapp:82 (an instance of my Node app listening port 82)
...
I wouldn't want to open so many ports externally, so I'd like to know if it's possible to have my clients accessing their apps through port 80:
Client 1: http://client1.myapp
Client 2: http://client2.myapp
...
and then have IIS redirect each request to its corresponding INTERNAL port, where the specific NodeJS app instance would be listening.
This way I only need port 80 opened externally.
Is this possible? Is this common practice?
Thanks in advance.
You can do what you suggested in your second example (sub domains). What you will need is a valid domain and a static IP address. You will need to add an A record (to your DNS server) to redirect all your sub domains to your IP (i.e. *.your_domain.com --> your IP address)
Then for each of your clients you will have to create a site with his header - clientX.your_domain.com
This is common practice. I also use this method to show my clients their websites.