How to trouble shoot my meteor site?

September 17, 2016 295 views
DigitalOcean Ubuntu

After a few hours of mupx (meteor up) debugging, I finally managed to get my website deployed on an Ubuntu 14.04 server-- success! according to mupx. But now when I navigate to my site (nodingbat.com) the site refuses to connect.

Any advice for how I can debug a situation like this? Looking for the files on the server but no luck... I ping the domain and the correct IP is showing. Anyone have any experience with mup? Any help would be appreciated!

1 Answer

By default Meteor may only be listening on localhost or you may have a firewall enabled on your droplet which is preventing it from listening on port 3000 which means that the droplet itself should be able to reach it but nobody outside the droplet will get a response on port 3000. Depending on your needs there are a couple ways around this:

1.) Set up a reverse proxy using Nginx

You can install nginx on your droplet using apt-get update; apt-get install nginx and configure it to listen on port 80 (http) and relay requests for your meteor service on port 3000. Something like this in your /etc/nginx/sites-enabled/default file will do the trick:

server {

        listen 80 default_server;
        listen [::]:80 default_server;

        root /usr/share/nginx/html;
        index index.html index.htm;
        server_name _;

        location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

}

2.) You could reconfigure your meteor app to listen on your public IP or 0.0.0.0 (all interfaces)

Have another answer? Share your knowledge.