By Ruz
I recently upgraded my DigitalOcean droplet from Ubuntu 22.04 to Ubuntu 24.04 LTS. After the upgrade, nginx started returning 502 Bad Gateway errors for all my sites.
I have checked the following so far:
Here is the relevant error from /var/log/nginx/error.log:
connect() failed (111: Connection refused) while connecting to upstream
My nginx config uses proxy_pass to forward requests to a Node.js application running on port 3000. The app works fine when accessed directly but nginx cannot proxy to it.
I suspect something changed with systemd socket activation or AppArmor profiles in Ubuntu 24.04 Noble Numbat. Has anyone else experienced this issue after upgrading?
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.
Heya,
the connect() failed (111: Connection refused) while connecting to upstream error almost always means an issue with the app behind the reverse proxy. Check the error logs of the app. It can be a broken function or something.
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.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
