51

I am new to Amazon EC2. The application is working fine on the Amazon EC2 Windows Server. But when i am trying to access the same through the public ip, it is not accessible. I have seen the inbound configurations and the ports(HTTP,HTTPS,SSH) are enabled.

I am unable to access the application through public ip.

 http:ec2-XX-XX-XXX-XX.us-west-2.compute.amazonaws.com 

is accessible when inside the EC2 region, however

XX.XX.XXX.XX:8080/myapp 

is not accessible.

XX.XX.XXX.XX is the public ip.

Yess.. This is VPC..!!!

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Jay
  • 835
  • 1
  • 6
  • 11
  • 1
    check firewall settings – Manan Sharma Dec 24 '16 at 09:11
  • 1
    Late reply. May be helpful for others. In your security group make sure if you are using SSH as inbound rule, change it to Anywhere. That should solve your purpose. [Never use anywhere for Real Apps. Just for learning purpose] – IllegalSkillsException Jul 29 '18 at 09:02
  • 5
    For me, issue was - I had enabled HTTP traffic over port 80 but Chrome was by default opening the public IP on HTTPS. Accessing it on HTTP fixed it for me. – Smile Mar 06 '21 at 03:16
  • Thanks smile your comment helped me solve this problem but previously I was not facing this issue can you please provide anything useful – Rajat Agrawal Oct 16 '21 at 11:16

6 Answers6

62

create security group with request you are wish to grant access. here I've created security group to any request

enter image description here

Then add the specific security group to network interface

enter image description here

Chinthaka Dinadasa
  • 3,332
  • 2
  • 28
  • 33
  • 1
    In addition to this enabling port 80 on windows firewall on ec2 instance works for me. – Thomas V J Oct 16 '18 at 08:36
  • If your inbound rules are correct then, check the windows firewall settings or turn off windows defender. Worked for me. I was also facing this issue for a couple of hours. – Sachin Parashar Mar 26 '19 at 19:19
  • Your public IP request goes through HTTP so enable that port from INBOUND. Solution: Open Security groups and edit a new security type with HTTP and Source custom with 0.0.0.0/0 allows any IP request. It's worked – Kaushik shrimali Sep 02 '19 at 07:14
15

This issue is due to subnet assign to ec2 have not internet gateway. For resolve: AWS Console:: VPC:: Create Internet gateway --> Assign to VPC --> Add internet gateway entry into route table that is assigned to ec2 subnet.

Dheeraj Kumar
  • 166
  • 1
  • 3
14

Had the same issue. Found it to be problem with Security Group. Added a 'Custom TCP Rule' with port 8080, and it worked just fine.

Sanjay Verma
  • 1,390
  • 22
  • 40
4

It looks more like a security group issue. What exactly did you set in the security group for the instance? In situations like this, I start by making sure ping works from outside by opening Echo Request for all IPs. If the machine is not pingable, fix it first. Then restrict the IP range.

helloV
  • 50,176
  • 7
  • 137
  • 145
1

Do the below checks

  • Have you attached the internet gateway, to your vpc, and if the subnet where the machine resides belongs to the subnet with Internet gateway
  • are you trying with IP address or FQDN, try yo ping to google, if it works well if not try to ping 4.2.2.2
  • If positive with any of the results, check the DNS entries and DNS resolutions if not change the EIP/ restart the instance
Jacco
  • 23,534
  • 17
  • 88
  • 105
Pasha
  • 798
  • 1
  • 5
  • 9
0

i have the same problem. AWS provide IPv6/IPv6 DNS and IPv4/IPv4 DNS.. in my case, IPv6 DNS is tagged private but accessible from internet while the public IPv4 DNS can only be accessible from the intranet.

Since i need to use nameserver from other provider, i use IPv6 ip as point to my domain.

Since u said your dns accessible(http:ec2-XX-XX-XXX-XX.us-west-2.compute.amazonaws.com ), ping using command tool to check the exact ip, and try to use that ip to browse..

zahrin
  • 11
  • 1
  • 1
  • 3