简体   繁体   English

AWS EC2实例访问内部服务器

[英]AWS EC2 instance access internal server

In my Amazon EC2 instance I have a Pyramid server as well as a NodeJS server running. 在我的Amazon EC2实例中,我有一个运行的Pyramid服务器和一个NodeJS服务器。 The NodeJS server acts as the frontend and I updated my security groups so I can use the public DNS to view the page. NodeJS服务器充当前端,并且我更新了安全组,因此可以使用公共DNS来查看页面。

The Pyramid server acts as a backend and the frontend accesses it by http://0.0.0.0:8002/ . 金字塔服务器充当后端,前端通过http://0.0.0.0:8002/访问它。 But when I do an http call to the backend I get a Failed to load resource: net::ERR_ADDRESS_INVALID error message. 但是,当我对后端进行http调用时, Failed to load resource: net::ERR_ADDRESS_INVALID错误消息。

Do I need to add a rule to the security groups, or update the iptables, or something? 我是否需要向安全组添加规​​则或更新iptables或其他内容?

If both of these services are running on the same server, you shouldn't be sending network traffic out of the server and back, so security groups will not be an issue here. 如果这两项服务都在同一台服务器上运行,则不应将网络流量发送出服务器再返回,因此安全组在这里不会成为问题。

The question is, why are you using 0.0.0.0 here? 问题是,为什么在这里使用0.0.0.0 I think you probably configured the Pyramid server to listen on 0.0.0.0 , which really means "listen on all IP addresses". 我认为您可能已将Pyramid服务器配置为侦听0.0.0.0 ,这实际上意味着“监听所有IP地址”。 However you need to be using http://127.0.0.1:8002/ or http://localhost:8002/ in order to connect to the service from another service running on the same server. 但是,您需要使用http://127.0.0.1:8002/http://localhost:8002/才能从同一服务器上运行的另一个服务连接到该服务。

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

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