简体   繁体   English

服务项目问题:将 Node.js 项目部署到 AWS EC2

[英]Serving Project Problem: Deployment Node.js project to AWS EC2

I did everything.我做了一切。 I've connected to my Instance, installed last versions of Npm and Node.js.我已连接到我的实例,安装了最新版本的 Npm 和 Node.js。 Cloned project from GitHub.从 GitHub 克隆项目。 Setted up Npm in the project directory and started the server.在工程目录下设置Npm并启动服务器。 So, I've got the server started message from the server on console.所以,我已经从控制台上的服务器收到了服务器启动消息。

But when I visit the Public IPv4 address of my Instance, I can't see any result.但是当我访问我的实例的公共 IPv4 地址时,我看不到任何结果。 There is nothing.空无一物。 I have tried 123.123.123.123 , and then tried 123.123.123.123:3000 but I can't see anything.我试过123.123.123.123 ,然后尝试123.123.123.123:3000但我什么也看不到。

And then I've installed Nginx but anyway there is nothing.然后我安装了 Nginx 但无论如何都没有。 What should I do?我应该怎么办? This is my first time on AWS EC2.这是我第一次使用 AWS EC2。 That's why I don't know what is the problem.这就是为什么我不知道是什么问题。 If you want any source code, I can share.如果你想要任何源代码,我可以分享。 But for now I though that it's not about any code of my project.但现在我认为这与我项目的任何代码无关。

Please go and check under your EC2 instance's security group that the in-bound rules allow port 3000 .请 go 并在您的 EC2 实例的安全组下检查入站规则是否允许端口3000

Also, you would need to add a proxy pass from your nginx server to your application server.此外,您需要从 nginx 服务器向应用程序服务器添加代理通行证。 You should also use PM2 to control your nodejs web application.您还应该使用 PM2 来控制您的 nodejs web 应用程序。

You can probably give some more details so that we can answer much more clearly.您可能可以提供更多详细信息,以便我们可以更清楚地回答。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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