I have a domain (example.com), and have followed every step (I think I have atleast) of the nodjs tutorial on digitalocean (https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04)
So, if I load up http://my_server_ip, I get the welcome to nginx screen.
If I load up my domain (example.com), the screen shows the sample html from the server nginx server blocks tutorial
If I load up my_server_ip:3000, nothing happens, even though localhost:3000 shows Hello World, from the node tutorial
My reverse proxy settings in the sites-available folder is as follows:
The check of the nginx files shows no errors, but I still cant see the hello world from outside the server. Can anyone point me in the right direction?
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.
Hi there @nah84,
I believe that you need to move the reverse proxy rule into the server block that handles the 443/HTTPS traffic like this:
Then run an Nginx test again with:
And if you get
Syntax OK
restart Nginx:If this is still not working, make sure that your Node application is actually listening on port 3000. You can check that with the following command:
If the application is listening on a different port you would need to adjust this accordingly in your proxy configuration.
Let me know how it goes! Regards, Bobby