I'm having an issue with my domain name routing setup. I can get "example.com" to resolve correctly from the browser but, I cannot get "www.example.com" to resolve. I have read the docs for my related tech and it all seems to be set up correctly (well I still need to set up HTTPS / TLS but this will come after I can get www.example.com to resolve).
I have an AWS EC2 instance (Ubuntu 16.04.3 LTS) with an elastic IP address associated with it. I also have a domain name on GoDaddy.
My web stack uses Nginx to serve a JS frontend framework and reverse proxying to a Django API.
In AWS console / Route53 I have the following:
- A record with name "example.com" pointing to my elastic IP 11.22.33.44
- NS record with name "example.com"
- SOA record with name "example.com"
- Another A record with name "www.example.com" pointing to my elastic IP 11.22.33.44
On my server I have the following server block for my Nginx config
server {
listen 80;
server_name example.com www.example.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/myproject/frontend/dist;
}
location /api/ {
include proxy_params;
proxy_pass http://unix:/home/myproject/backend/webapp/webapp.sock;
}
location / {
root /home/myproject/frontend/dist;
try_files $uri $uri/ /home/myproject/frontend/dist/index.html;
}
}
I'm sure I'm doing something dumb but, I cannot seem to figure it out. Appreciate any guidance.
www.mydomain.com still does not resolve.
from where? Your local machine? Did you try doing a nslookup or dig from a terminal? – Shawn C.