Hi
I have created two droplets, one for react app, which I had deployed successfully.
Now I want to deploy node app on another droplet using subdomain concept, as My react droplet is already using domain name with floating ip attached.
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!
Heya,
Deploying a Node.js app on a subdomain is a great idea, and you can follow these steps:
Create an A Record for your subdomain in your domain management system (DNS), pointing it to your second droplet’s IP address.
In the second droplet, install Nginx to serve as a reverse proxy for your Node.js app. You can follow the steps here: How To Install Nginx on Ubuntu 20.04.
Configure Nginx to proxy requests to your Node.js app running on the second droplet by adding a new server block for your subdomain. You can check out this tutorial on setting up a reverse proxy: How To Set Up a Node.js Application for Production on Ubuntu 20.04.
Restart Nginx to apply the configuration changes.
Ensure your Node.js app is running on the second droplet, and it should now be accessible via the subdomain.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.