I want to run two different apps on two different sub domains under one droplet.
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!
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.
In order to run two Node apps on a single Droplet, you’ll need to configure a reverse proxy to direct requests to the correct applications. Nginx is a popular choice for doing this. Each app will need to be configured to listen on a separate port locally while Nginx will listen publicly with a “server block” for each app. A quick minimal example of the Nginx configuration would look like:
Depending on the details of your applications, there may be additional configuration needed. Check out these tutorials for more information. The first covers Nginx server blocks; the second is specifically on using Nginx as a reverse proxy for Node apps:
@asb i did the same config but the sub domain not working. but the ip:port still running right
did it need to setup DNS ??
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.
Sign up now