critical

502 Bad Gateway

A proxy or gateway received an invalid response from an upstream server.

Common Causes

  1. 1Upstream server crashed or is unreachable
  2. 2Nginx/Apache misconfigured proxy settings
  3. 3Upstream server timeout
  4. 4DNS resolution failure for upstream

How to Fix

Increase proxy timeout

# Nginx
location / {
    proxy_pass http://backend;
    proxy_connect_timeout 60s;
    proxy_read_timeout 120s;
    proxy_send_timeout 60s;
}

Increase proxy timeouts for slow upstream servers.

How ObserveOne Helps

ObserveOne monitors upstream health and alerts when gateways start returning 502 errors.

Start Monitoring Free

Related Errors