I deployed a code on an AWS ec2 instance.
I also added security groups to allow public access to the instance
I made sure that the firewall is disabled
The IP tables also seem to be in order
I'm still unable to access the website via public IP & browser
Using the following command to ping the server's public IP address -
Using the command - Test-NetConnection -computername <public IP>
It seems like its working. However, when I add the desired port number to the command
Test-NetConnection -computername <public IP> -port 8080
It seems like the test is failing
What am I missing?
Servers do not only listen on ports, but also on addresses. You have entered localhost:8080
i.e. 127.0.0.1:8080
which means the server will accept connections at address 127.0.0.1, port 8080. If you would connect to this address it would work. Except this address isn't reachable over the network.
If you would tell it to listen on the server's (private) IP address (172.something), or 0.0.0.0 which means "any address", then it would work. Typically, 0.0.0.0 is used for listening addresses to allow connections from the network, or 127.0.0.1 is used to only allow connections from the same computer. It's rare to use other listening addresses, but it can be done if your computer has two networks and you only want the server to work from one of them.