Question

Can't launch my node application

  • Posted on February 22, 2015
  • chris92Asked by chris92

Hey I have followed this tutorial successfully: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04 but my node app is yet to come up. When I ran curl http://APP_PRIVATE_IP_ADDRESS:8080 in the CLI i got my html file returned.

What can I do please? Regards


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This comment has been deleted

It’s not clear exactly where your problem is located. Any further information that you can provide would help us figure out your issue.

That tutorial assumes that you are running two separate servers, a proxy server and an app server. You could simplify the set up by running the Nginx reverse proxy on the same server as the Node app. Essentially, all you would need to change is instead of using APP_PRIVATE_IP_ADDRESS use 127.0.0.1 This will serve your Node app on localhost, and then Nginx will proxy it to port 80 where it will be publically available.

For instance, this is what your Nginx configuration would look like:

server {
    listen 80;

    server_name example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}