Domain name not getting connected to droplet but ip with port number does

November 9, 2017 2.2k views
Deployment DNS Firewall Networking Nginx Ubuntu 16.04

I am unable to get my domain name connected to my droplet which is hosting an angular 2 application. I am able to ping the domain name and see the reply with proper ip address in it. I am also able to open the application with ip address like but trying with my domain name like returns error -

This site can’t be reached
refused to connect.

Any help is much appreciated.

3 Answers

Used --disable-host-check with ng serve.

  • Hi,
    Is there any chance you could provide some details on how to implement --disable-host-check with ng serve? I have a React/Express/Node app on digitalocean, but my domain doesn't work. It only works if I add the port number I was hoping your solution might fix this, but don't know how to implement it.

Supply the port with your domain.

without specifying the port, your browser will try to connect to port 80

Can you use the following command to start the angular app?

ng serve --host --port 80

This will start your app on the droplet on port 80. It will also start with the correct hostname information too.

Have another answer? Share your knowledge.