Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon AWS EC2, Allow inbound http Request

I have deployed a nodejs application in AWS EC2 instance. It has API gateway with '/api/companies' endpoint. After starting my server I am able to cURL from the instance terminal and it returns the result correctly. But I am not able to make the request from my browser to the EC2 instance. I am not sure exactly how to modify the inbound rules to make this work

like image 915
Prasanna Mahendiran Avatar asked Mar 05 '26 00:03

Prasanna Mahendiran


2 Answers

You might want to check out the Security Group Rules documentation, but the gist is:

  1. Create a new Security Group in your VPC for your EC2 instance
  2. In the Inbound rules, create a new rule
  3. Set the Source to your IP address. (Optional, if you want to allow access from any IP address, enter 0.0.0.0/0 in the Source)
  4. Set the Protocol to tcp, and set the Port to 80 or 443 depending on what your application uses
like image 149
Jamie Starke Avatar answered Mar 06 '26 14:03

Jamie Starke


  • Edit your existing security group or add a new security group
  • Select the VPC the instance is running in. The attached image shows No VPC, but you have to select your VPC
  • For Source, you can choose My IP if you want to allow inbound traffic from your IP only or from Anywhere in the world

enter image description here

like image 43
helloV Avatar answered Mar 06 '26 13:03

helloV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!