Nginx: connect() failed (111: Connection refused) while connecting to upstream

Nginx tried forwarding to an upstream host:port where no process is listening.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.0.0
Identifier: Nginx: connect() failed (111: Connection refused) while connecting to upstream Platform: Nginx

Interactive Diagnostic Checklist

Safe Diagnostic Command:
sudo nginx -t && ss -tlnp | grep -E "3000|8080|5000"

Technical Explanation

Nginx tried forwarding to an upstream host:port where no process is listening. Verified resolution path: Verify backend service status (PM2/systemd/Docker) and confirm listen address matches proxy_pass.

Worked Examples

  • Read-only diagnostic command: sudo nginx -t && ss -tlnp | grep -E "3000|8080|5000"

Limitations & Assumptions

  • Always verify which infrastructure layer (CDN, Nginx, runtime, OS, or database) emitted the error before modifying production config.

Source References & Verification

Resource ID: err-nginx-connect-failed-111 · Independently verified: 2026-11-25

Related Resources