Let’s say my domains are:
I want all of them to go to the same IP address (Droplet) which is running NodeJS. Basically, the three web sites all have the same content.
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.
You’ll need to configure Nginx as a reverse proxy for that.
What Nginx does is receives traffic on port 80 and 443 for your domains and depending on their Nginx configuration, redirects them internally to a specified port on which NodeJS is listening.
That’s the basis of it, I know it doesn’t let you know how to configure it actually but this is what the next tutorial is for:
Check it out, it helps with installing NodeJS, PM2, configuring and installing Nginx as a reverse proxy server.
You can follow Step 4 of the tutorial multiple times( the configuration part) for your 3 domains. The only thing I would suggest is to change the internal port your Nginx will be redirecting for each domain.
Have something to build?