How to Fix HTTP 502 Bad Gateway

An edge proxy, CDN, or load balancer received an invalid response or connection reset from the upstream origin web application server.

Category: Upstream Origin Failure ยท Associated Platform: Discord (Status: Elevated Reports)

Verified Step-by-Step Fixes

  1. Step 1: Hard-Refresh Browser Bypassing CDN Cache (Ctrl + F5)

    Press Ctrl+Shift+R (Windows) or Cmd+Shift+R (macOS) to bypass cached 502 error pages served by intermediate edge proxies.

  2. Step 2: Test Alternative Regional Edge via 1.1.1.1 DNS

    Switching recursive DNS can route your request to a healthy Anycast PoP if a single regional gateway is overloaded.

  3. Step 3: Verify Upstream Origin Keep-Alive & Timeout Limits

    For site operators: ensure NGINX/Node keepalive_timeout exceeds the CDN idle timeout (60s+) to prevent connection resets.

Diagnostic Tools

Test domain connectivity directly using our Run Origin & Header Check.

Related Error Guides