Search code examples
amazon-web-servicesamazon-ec2dnsamazon-route53nameservers

Point EC2 instance to GoDaddy domain


I already have a domain, like exmaple.com and I have a simple app running on an ec2 instance.

I've allocated an elastic IP for this instance, and created a zone on route 53, created A record, and also an alias record.

I have updated the nameservers from route53 NS records in GoDaddy domain settings(and I should mention that I've waited 48 hours for ns to be propagated, and that part is fine).

When I ping example.com on my own computer, the DNS Name resolve to the correct IP address. When I check the elastic IP, it's working and shows my website, but when I check example.com it does not show my app and shows This site can’t be reached: this is a screenshot of what it shows

I cannot see where's the problem!

Solution

  • Based on the comments.

    The issue was due to using https, rather then http. The http connection works. To setup https the following general procedure needs to be undertaken:

    1. Get a public SSL certificate. Since you are using instance, you can't use AWS ACM for that. In this case a popular choice is https://letsencrypt.org/ where you can register free SSL certificate for your domain and its subdomains.
    2. Setup ssl connectivity on your instance. Often this is done by using nginx as a revers proxy. The nginx will provide HTTPS for your instance using the SSL certificates from step 1.
    3. Open port 443 (HTTPS) in your security group.

    The alternative is to front your instance with an application load balancer (ALB). Using it, you can easily get free AWS ACM free certificate and deploy it on the ALB. No actions required on your instance in this case.