Cannot access my ec2 instance from Public DNS or Public IP

0

Hi, I cannot access my ec2 instance using Public DNS or Public IP. I have check the security group, subnet, dns, everything is fine but still I cannot reach the Public IP or DNS. Please Help. I use docker inside my ec2 instance

Orbital
질문됨 3달 전344회 조회
2개 답변
1

If you want to host a website via EC2 and access website content via IP address, you may need to use Apache or NGINX (even you already enabled HTTP traffic at SG level)

You can learn how to setup NGINX at this link: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04

profile picture
답변함 3달 전
  • Yes, use nginx as other container, so is it different?

0

Hello.

Are you accessing public IP and public DNS using HTTP?
If you are accessing via HTTP, please check if the web server (Apache, etc.) is running on the EC2 OS.
Also, is the route to the internet gateway set in the route table where EC2 is running?
Even if a public IP is set on EC2 and traffic is permitted in the security group, public communication will not be possible if there is no route to the Internet gateway.

profile picture
전문가
답변함 3달 전
profile picture
전문가
검토됨 3달 전
  • If you are using a Docker container, have you set the port number so that it can be accessed from the outside as shown below?

    docker run --name nginx01 -d -p 80:80 nginx
    

    Can you check the status of the Docker container with the following command? If there are no problems, you should be able to see output like the one below when you run the command. Make sure the "STATUS" column is UP.

    docker ps
    
    CONTAINER ID   IMAGE     COMMAND                  CREATED              STATUS              PORTS                  NAMES
    73fa6c221e80   nginx     "/docker-entrypoint.…"   About a minute ago   Up About a minute   0.0.0.0:80->80/tcp   nginx01
    

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠