无法从Internet访问使用端口3000的AWS中的NodeJs App [英] NodeJs App in AWS using port 3000 is not accessible from Internet

查看:81
本文介绍了无法从Internet访问使用端口3000的AWS中的NodeJs App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用免费套餐 AWS Linux实例,我已经安装了NodeJ,并启动了 Express JS 应用程序( sudo node bin / www )我的应用程序在端口3000上运行。

I am using free tier AWS Linux instance, I had installed NodeJs and started my Express JS app (sudo node bin/www) my app is running on port 3000.

当我对实例进行SSH并执行cURL时,我的应用程序正在响应,但没有响应

When I ssh to the instance and do cURL my app is responding but not from Chrome using Instance Public IP.

我在安全组中添加了端口80、22、3000。从任何地方的应用程序。 [附加的ScreenShot]
实例在 N中运行。弗吉尼亚州地区

I have added Ports 80, 22, 3000 in Security Groups to access the app from anywhere. [Attached ScreenShot] The instance is running in N. Virginia region.

以下是我尝试使其工作的情况:


  • 使用公共IP (端口3000)启动我的应用

  • 启动我的应用使用私有IP 和端口3000
  • 的应用程序
  • 使用 0.0.0.0 使用端口3000

  • 使用 localhost 和端口3000

  • Started my app using Public IP with port 3000
  • Started my app using Private IP with port 3000
  • Started my app using 0.0.0.0 with port 3000
  • Started my app using localhost with port 3000

上述所有情况均失败,当我SSH到实例并执行cURL时,我的应用程序正在响应。

All the above cases failed, when I ssh to the instance and do cURL my app is responding.

有人可以给我更多的见解吗?在这? 我丢失了任何东西。我被这个阻塞了。

Could someone give me more insights on this? or I am missing anything. I have been blocked by this.

当我将端口设置为 80 时,我可以访问应用程序需要使用端口 3000 ,因为我在端口 80 上运行Frontend Framework。

I am able to access app when I set the port to 80 but I need to use port 3000 because I am running Frontend Framework on port 80.

使用yum在服务器上安装软件:


  • yum更新

  • gcc-c ++ make

  • openssl-devel

  • 官方网站上的nodejs

  • npm install -g npm //更新npm

  • mongodb

  • yum update
  • gcc-c++ make
  • openssl-devel
  • nodejs from official website
  • npm install -g npm // update npm
  • mongodb

AWS安全组屏幕截图

PS:我已阅读所有有关该应用程序的StackOverflow问题都无法从Internet访问,但就我而言,可以从端口 80 访问我的应用程序,而不能从 3000

P.S: I have read all the StackOverflow questions regarding the app not accessible from the internet, but in my case, my app is accessible from port 80 not from 3000.

推荐答案

可能是您正在尝试从通过por进行出站连接的网络访问应用程序t 3000被阻止。大多数公司网络只允许某些特定类型的流量离开网络,通常是http(s)等。
尝试从另一个网络或其他区域内的ec2-host测试它。

It could be that you are trying to reach your application from a network in which outbound connections on port 3000 are blocked. Most corporate network only allow some specific kinds of traffic to leave the network, usually http(s) and such. Try testing it from another network, or from an ec2-host within a different region.

这篇关于无法从Internet访问使用端口3000的AWS中的NodeJs App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆