1

I have hosted both my angular(port no 4200) and node application(port no 3000) on the same EC2 instance. Both are currently accessible to anyone. I want to limit access to the Node application so that only Angular is able to connect with it and blocked for everyone else.

What I have already done:-

  1. EC2 security group inbound rule for port 3000 set to its own public IP xx.xx.xx.xx/32

  2. EC2 security group inbound rule for port 3000 set to its own private IP 172.xx.xx.xx/32

In both cases, I am getting timed out error from my node application.

OPTIONS http://xx.xx.xx.xx:3000 net::ERR_CONNECTION_TIMED_OUT

1 Answer 1

0

If they are on the same instance you may want to refer to the NodeJS app from Angular as http://127.0.0.1:3000 - that way the traffic stays completely inside the machine and won't traverse the AWS infrastructure at all.

See Localhost for more info.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .