![](/img/trans.png)
[英]Run multiple Node js apps on single EC2 instance on different port
[英]Is there any other option to run multiple node app on ec2 instance
我在文件夹中的节点 js 中有 3 个文件/应用程序
mis1.js running on port 3000
mis2.js running on port 3002
mis3.js running on port 3003
但是当我在 ec2 实例上运行它时它显示
ubuntu@ip-172-31-7-220:~/microservice$ node mis2.js
Server running at http://localhost:3002/
但是在浏览器上我只能访问 3000 的应用程序
在我的安全组中,我允许所有端口 3000-3010
sudo pm2 <entry file name>
示例sudo pm2 mis1.js
运行三个应用程序。 当您使用 cmd/ctrl C 时,它会杀死应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.