pointing DO ip to domain name issue

April 15, 2016 329 views
DNS Configuration Management DigitalOcean

When I type just the domain name ( 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 :
$TTL 1800 IN SOA 1460733212 10800 3600 604800 1800 1800 IN NS 1800 IN NS 1800 IN NS 1800 IN A
* 1800 IN CNAME

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.

Have another answer? Share your knowledge.