title: Can't get Meteor app deployed on Ubuntu (Nginx issue)
body: <p>I can't get meteor app deployed on my VPS (It's new VPS with fresh Ubuntu installation).</p>
  
  <p>I followed well this tutorial:
  <a href="https://www.digitalocean.com/community/tutorials/how-to-deploy-a-meteor-js-application-on-ubuntu-14-04-with-nginx#step-1-%E2%80%94-setting-up-an-nginx-web-server" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-deploy-a-meteor-js-application-on-ubuntu-14-04-with-nginx#step-1-%E2%80%94-setting-up-an-nginx-web-server</a></p>
  
  <p>From A to Z.</p>
  
  <p>But when i test my application i get:</p>
  
  <pre><code>502 Bad Gateway.
  </code></pre>
  
  <p>I check status of:</p>
  
  <pre><code>service nginx status
  status mongodb
  </code></pre>
  
  <p>It's ok, but:</p>
  
  <pre><code>status myapp
  </code></pre>
  
  <p>Return: <code>myapp stop/waiting</code></p>
  
  <p>Checked the logs:</p>
  
  <pre><code>/home/myapp/myapp.log
  </code></pre>
  
  <p>There nothing.</p>
  
  <p>Same as mongodb logs.</p>
  
  <p>But found this on nginx logs:</p>
  
  <pre><code>2018/03/02 01:08:19 [error] 2651#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: XX.XX.XX.XX, server: 185.12.85.65, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "185.12.85.65"
  2018/03/02 02:57:11 [error] 2653#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: XX.XX.XX.XX, server: 185.12.85.65, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "185.12.85.65"
  2018/03/02 12:52:16 [error] 2655#0: *25 connect() failed (111: Connection refused) while connecting to upstream, client: XX.XX.XX.XX, server: 185.12.85.65, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "185.12.85.65"
  </code></pre>
  
  <p>Nginx location:</p>
  
  <pre><code># pass all requests to Meteor
  location / {
      proxy_pass http://127.0.0.1:3000;
      #proxy_pass http://0.0.0.0:8080;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade; # allow websockets
      proxy_set_header Connection $connection_upgrade;
      proxy_set_header X-Forwarded-For $remote_addr; # preserve client IP
  
      # this setting allows the browser to cache the application in a way compatible with Meteor
      # on every applicaiton update the name of CSS and JS file is different, so they can be cache infinitely (here: 30 days)
      # the root path (/) MUST NOT be cached
      if ($uri != '/') {
          expires 30d;
      }
  }
  </code></pre>
  
  <p>I noticied that port 3000 not opened.</p>
  
  <pre><code>PID/Program name
  tcp        0      0 127.0.0.1:28017         0.0.0.0:*               LISTEN      787/mongod
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      784/sshd
  tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      6578/nginx
  tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      787/mongod
  tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      6578/nginx
  tcp6       0      0 :::22                   :::*                    LISTEN      784/sshd
  tcp6       0      0 :::80                   :::*                    LISTEN      6578/nginx
  </code></pre>
  
  <p>Any one encountred this problem before ? Any fix please ?</p>