I cannot access my Django app on an EC2 instance (host2) in my browser by typing its public DNS name with port number: ec2-public-dns-of-this-instance.compute-1.amazonaws.com:8000
- I'm using the same Security Group that my other EC2 instance (host1) is using which is working just fine (my other Django app hosted on this instance works perfectly fine), with HTTP/TCP open on 0.0.0.0/0 on port 8000
- I started my Django project this way:
./manage.py runserver 0.0.0.0:8000
- I've added hosts into my
ALLOWED_HOSTS
file which has these now:ALLOWED_HOSTS = ['*', '127.0.0.1', 'ec2-public-dns-of-this-instance.compute-1.amazonaws.com', '0.0.0.0', 'localhost']
- I was able to
curl localhost:8000
which returned me 200 and Django default HTML page when I'm ssh'ed into this instance. - I was able to
curl ec2-public-dns-of-this-instance.compute-1.amazonaws.com:8000
which also returned me 200 and Django default HTML page when I'm ssh'ed into this instance. - both host1 and host2 are using the exactly the same subnet, VPC, SG, AMI, in the same AZ.
- both host1 and host2 are running on AMI Ubuntu 18.04 LTS
Any ideas how to fix this would be greatly appreciated!