nginx connection_error ai_generated true

connect() failed: Connection refused while connecting to upstream

ID: nginx/connection-refused-upstream

Also available as: JSON · Markdown
82%Fix Rate
86%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1 active

Root Cause

Upstream server not listening on configured port.

generic

Workarounds

  1. 92% success Verify upstream server is running on the configured host:port
  2. 88% success Check if upstream uses socket file vs TCP port correctly

Dead Ends

Common approaches that don't work:

  1. Change upstream to random port 95% fail

    Will never connect

  2. Remove the upstream block and use direct proxy_pass 70% fail

    Loses load balancing