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!
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.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
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:
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!
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.