简体   繁体   中英

Hosting multiple nodejs on same server/domain name

I'm intending to host an online portfolio and I have several node.js projects I'd like to host.

So I'd like to host one project on domain.net/project1 and the other on domain.net/project2

Do I need to use a single nodejs process to do this, or is it possible to have each of my separate nodejs projects running independently?

Is it possible to assign a nodejs process to each subdomain?

A better approach will be to host your NodeJS projects independently and then use the domain(hosted and provided by platform) to Custom Sub-Domain(created by you) pointing to point each of your projects to custom subdomains like project1.mydomain.com. This will provide you the flexibility to deploy your node applications on Heroku, AWS or any other hosting environment.

Thus you get freedom of choosing your own hosting platform and can have as many projects hosted as needed. I have attached an architecture diagram for the same and the link to the original draw.io document. Also please note that this is just a sample, and your design may vary as per your specific requirements

在此处输入图片说明

You can refer this Arc diagram for more details.

You can use nginx or apache http for host each project or create a path that contains sub paths for each one.

Here come references:

Apache http

nginx hosting

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM