By lvincek
I have come to a complete dead end on getting my app to run.
I was trying to use the following instructions:
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04
I have tried two different apps in my droplet. The first one was a react app, so I was using ‘npm start’. Then, I put a more simple html app in, so ‘node app’ was sufficient.
In both cases, I was able to get my apps to work on localhost. “npm start”, “node app”, and then also things such as “pm2 start app” and “pm2 start npm – start” all worked. So, my app was spun up.
Also, my nginx appears to have at least started. When I goto <ip address>:<port number> or <domain name>.com from a browser on my machine, I get that standard “welcome to NGINX screen”.
When I ran the script “sudo nginx -t”, it said everything was fine.
I also allowed with “sudo ufw allow ‘Nginx Full’”."
my /etc/nginx/sites-available/default reads like:
server { listen 80;
server_name <domain name>.com;
location / {
proxy_pass http://localhost:<port>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
I have been through the instructions so many times, and I can’t see how I have not followed them to a ‘t’. Any suggestions on why I can’t see my page?
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!
Accepted Answer
Hi @lvincek Did you remember to reload/restart Nginx after you made the changes? Because you should not be seeing the “Welcome to Nginx” with that configuration. Normally, it’s a good idea to test configuration, then reload/restart if no errors:
sudo service nginx configtest
sudo service nginx reload
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.