Set up nginx with multiple domains and node process

As I was following this tutorial:

It doesn’t seem to work, as when i completed all steps and went to the sub domain it says this site cannot be reached, but if i just go to the ip it just shows this:


Submit an 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.

Hi there @selll,

I would recommend following the steps from this tutorial here instead:

Then once you want to start a second Node.js application keep the following things in mind:

  • Make sure that you use a different port for each application
  • Make a copy of the /etc/nginx/sites-available/default to /etc/nginx/sites-available/example2.conf and adjust the values there to match your second application
  • Then enable the second site:
  1. ln -s /etc/nginx/sites-available/example2.conf /etc/nginx/sites-example/example2.conf

Finally, restart Nginx as explained in the tutorial.

Let me know how it goes. Regards, Bobby