I'm hosting a default site for apache2 server on AWS EC2 (Ubuntu) with Elastic IP.
Security group set to open all inbound (testing purposed).
I can access the server via SSH using public IP but I can't via HTTP.
I can browse the site from localhost (using lynx 127.0.0.1).
I can also browse the site from a different EC2 on the same subnet.
Here is my iptables:
-P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT open ports:
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* tcp LISTEN 0 511 *:80 *:* tcp LISTEN 0 128 [::]:22 [::]:* tcp LISTEN 0 511 *:443 *:* Firewalls are inactive.
I have also just tried installing nginx on that second VM I spinned on the same subnet and curiously I also can't access the web server o port 80.
So now I also created a new instance on a separate subnet and still can't reach it via HTTP. It is reachable via SSH though.
Not sure what am I missing.
Update 1:
That's extremely bizarre, I have also MySQL running on that machine which is also accessible. Seems that routing and security groups are all correct but for some reason HTTP and HTTPS traffic is being blocked by something.
Update 2:
I turned on Flow logs on VPC and all my request on port 80 rejected, 22 and 3306 get in without problem.
my.ip.goes.here. 10.1.1.68 64087 80 6 1 64 1694528397 1694528415 REJECT OK Network ACL is set to allow all inbound and outbound:
100 All traffic All All 0.0.0.0/0 Allow * All traffic All All 0.0.0.0/0 Deny Security Group allows all traffic in and out:
All Traffic 0.0.0.0/0 This is getting stranger and stranger.