简体   繁体   中英

AWS EC2 instance access internal server

In my Amazon EC2 instance I have a Pyramid server as well as a NodeJS server running. The NodeJS server acts as the frontend and I updated my security groups so I can use the public DNS to view the page.

The Pyramid server acts as a backend and the frontend accesses it by 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.

Do I need to add a rule to the security groups, or update the iptables, or something?

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? I think you probably configured the Pyramid server to listen on 0.0.0.0 , which really means "listen on all IP addresses". 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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