Hi Guys,
no live upstreams while connecting to upstream - Really fed up from this error. any help would be really appreciated.
below is the file content of /etc/nginx/sites-available/example.com
server {
server_name example.com www.example.com;
root /var/www/shopify/First/html;
index index.html;
location / {
proxy_pass http://localhost:3000;
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;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name example.com www.example.com;
return 404; # managed by Certbot
}
It is working for IP address(but only index.html). Path for node js app is not opening for IP address.
node js app is working for localhost:3000
kindly help.
thanks in advance.
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!
Heya,
The error # no live upstreams while connecting to upstream usually indicates an issue with the application rather than your Nginx configuration. Check your nodejs error logs to see what errors are displayed there and you’ll be able to track the issue.
Heya,
The error usually indicates that Nginx is unable to send the request to the node.js server. Here are a few things to check:
Make sure that your Node.js application is running correctly and accessible without any issues on localhost:3000.
If you’re in a Docker environment, replace localhost with the name of your Node.js container.
Add an additional line under your proxy_pass directive to handle proxy errors:
- proxy_next_upstream error timeout` `http_500 http_502 http_503 http_504;
You can find more about Nginx reverse proxy setup in our DigitalOcean tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-22-04
Hope that this helps!
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.