Route53 domain name not working (godaddy domain)

Viewed 366

I deployed my Django website on ec2 ubuntu instance. I have associated an elastic IP to my ec2 instance and it works fine when I ping the IP and it shows my website. I configured Route53 and mapped with my GoDaddy domain name. Now, when I use my domain name it is showing the Nginx default page but not my website. However, with IP it works fine.

enter image description here enter image description here

2 Answers

In Nginx configuration, make sure that the server_name directive has your domain name and not an IP address.

server {
    server_name  example.org  www.example.org;
    ...
}

Moreover, also bear in mind that you should not use ephemeral IPs in DNS records, please use a DNS name or a static IP.

Your website showing Nginx server installed page , that means you have correctly pointed your Go-daddy domain to your AWS Ec2 IP. and now you dont need to do anything with Go-daddy..

So Now lets look at your AWS Ec2 Nginx .

currently it showing "Nginx server installed page" which is default index.html file, which is in /usr/share/nginx/html folder. This get auto add when you installs Nginx server. successful Nginx installation shows this default page.

To show your own website page , you need to add 2 things in server block of Nginx.conf file

1) assign your domain name to `server_name` directive. 

2) assign folder/path of your website directory (root directory having index file) to `root` 

like below:

server {
    listen       80;
        listen       [::]:80;
        server_name  example.com www.example.com;
        root         /usr/share/nginx/html/example/;
      ...
      }
Related