Error Codes Wiki

HTTP 502 Bad Gateway — Upstream Server Error

Critical5xx server error

Overview

HTTP 502 Bad Gateway means a gateway or proxy received an invalid response from the upstream server.

Key Details

  • Status: 502 Bad Gateway
  • Category: 5xx Server Error
  • Proxy/gateway received invalid upstream response
  • Usually a backend server issue

Common Causes

  • Backend server crashed or is down
  • Upstream server returned an invalid response
  • Load balancer cannot reach backend
  • PHP/Node/Python process died

Steps

  1. 1Wait and retry — often temporary
  2. 2Check if the backend server is running
  3. 3Review upstream server logs
  4. 4Verify load balancer and proxy configuration

Tags

http-status5xx-server-errorhttp-502httpstatus-code

More in 5xx Server Error

Frequently Asked Questions

Usually the backend application crashed or is overloaded.