![](/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.