pointing DO ip to domain name issue

April 15, 2016 1.8k views
DigitalOcean DNS Configuration Management

When I type just the domain name (jessicafooskas.com) or just the ip address ( in to the url bar I keep getting a connection refused. But when I add the port 3000 at the end it seems to work? ex(

What do I need to do in order to not have to specify the port at the end, to just get it to show up?

My DO network domain config looks like this :
$ORIGIN jessicafooskas.com.
$TTL 1800
jessicafooskas.com. IN SOA ns1.digitalocean.com. hostmaster.jessicafooskas.com. 1460733212 10800 3600 604800 1800
jessicafooskas.com. 1800 IN NS ns1.digitalocean.com.
jessicafooskas.com. 1800 IN NS ns2.digitalocean.com.
jessicafooskas.com. 1800 IN NS ns3.digitalocean.com.
jessicafooskas.com. 1800 IN A
*.jessicafooskas.com. 1800 IN CNAME jessicafooskas.com.

2 Answers

Generally for most applications that provide their own http service you would configure a web server like nginx on your droplet to act as a proxy. This would mean that nginx would accept requests on port 80 (http) or port 443 (https) or both and route those requests to the service running on port 3000, returning the data the same way.

To do this, first install nginx:

apt-get update
apt-get -y install nginx

Then open the file /etc/nginx/sites-enabled/default and edit it to look like this:

server {
        listen   80; 

       location / {

        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;


and restart nginx for the change to take effect:

service nginx restart

This should get your site to respond on port 80. I would recommend, once this is configured, you look into configuring a firewall to block public access to port 3000.

It works thank you!

Have another answer? Share your knowledge.
