I have a domain which was working on a wordpress site hosted at hostgator. Was working fine. I have migrated the server to an AWS free tier EC2 instance, already setup nginx, mysql, php and everything. The site works when accessing the machine public ip, already inserted the domain at nginx sites-enabled/site.conf file but I can't get it to work. On my registro.br I have linked the dns to the urls given by aws route 53 after creating a hosted zone. Can anyone tell me what I did wrong?
I've checked https://www.whatsmydns.net/#A/gblanc.com.br and it shows some X and no error messages, not sure what it means
Some prints and nginx config file:
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443;
root /var/www/html/agenciaboz;
index index.php index.html index.htm index.nginx-debian.html;
server_name gblanc.com.br;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
aws route print: aws route 53 print
my domain register print: my domain register print
CodePudding user response:
From what it looks like in Route 53 you redirect www.gblanc.com.br
to gblanc.com.br
:
$ host www.gblanc.com.br
www.gblanc.com.br is an alias for gblanc.com.br.
but gblanc.com.br
doesn't have an IP address:
$ host gblanc.com.br
$
You'll need to create an A record for gblanc.com.br
that points to your EC2 IP address. You need to understand that if you stop and start that EC2 you'll get a different IP address so you may want to look at using an Elastic IP that won't change.