Question

Nodejs app how to load domain instead of ip + port

I have an app that I would like to load using a domain name instead of the ip:port. It currently loads find with the ip and port but I can not get it to work with a domain. I have created the subdomain A record and tried a few tutorials. None of which seem to work. These two seemed promising but still did not work for me: https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension

https://www.digitalocean.com/community/questions/nodejs-app-loads-in-browser-via-ip-port-but-not-domain-port-dns-set-to-do-servers-in-registrar-account-a-and-cname-are-set-help


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.

Hello,

This is doable with Nginx. You can follow the instructions from step 5 from this tutorial here on how to setup Nginx as a reverse proxy for your Node.js App:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#step-5-setting-up-nginx-as-a-reverse-proxy-server

You can also follow the steps on how to do that in this video here:

Best,

Bobby