Question

what port my node.js/next.js should go through with nginx? or am i missing something else?

Posted September 27, 2018 1.1k views
Nginx Node.js Ubuntu 18.04

I’m using ‘one click’ made droplet with node.js. i got nginx running and showing its default page when i go to the IP address of the droplet. i have cloned my project into the droplet and 'npm install’ it, i can run it using 'npm run dev – -p <port>’ and i can see the message it’s running. i have tried few ports but i can’t figure out what i’m missing.
when i go to '000.00.000.000’ i see nginx default page, and when i try '000.00.000.000:3000’ or other port i get nothing.
Please help me figure out what to do, i’m already started 'using’ and it’s costs money.
thanks.

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.

2 answers

Try specifying the wildcard host:

npm run dev -- -p 3000 --host 0.0.0.0

Then access it via your server’s IP and port 3000.

Submit an Answer