How do I host multiple Node.js sites on the same IP/server with different domains?

前端 未结 12 818
轻奢々
轻奢々 2020-11-28 01:03

I have a linux server with a single IP bound to it. I want to host multiple Node.js sites on this server on this IP, each (obviously) with a unique domain or subdomain. I wa

12条回答
  •  粉色の甜心
    2020-11-28 01:18

    Choose one of:

    • Use some other server (like nginx) as a reverse proxy.
    • Use node-http-proxy as a reverse proxy.
    • Use the vhost middleware if each domain can be served from the same Connect/Express codebase and node.js instance.

提交回复
热议问题