Question
NodeJS, Nginx, domain name not resolving without www.
Hi guys,
So I have a domain name registered as luckynote.io. I’ve been working with this domain for a month now let’s say, and today when I ran my droplet I could not access the server through this domain. However, if I try with www.luckynote.io I can access the server, but I can’t figure out why it won’t work with the A record (luckynote.io).
I have Nginx installed and configured and I am serving a MERN app on the server. I’ve also been running sudo nginx -t
, and all the nginx files seem to be in order The Nginx server-block for luckynote.io is as follows:
server {
listen 80;
listen [::]:80;
server_name luckynote.io www.luckynote.io;
location {
proxy_pass http://localhost:3000;
}
}
I’ve also made the soft link between this server block and the sites-enabled directory.
Any help would be gladly appreciated.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×