← All Status Codes
502
Bad Gateway
🔴 Server Error Critical Risk

📖 What Is HTTP 502?

The server acting as a gateway or proxy received an invalid response from the upstream server. The backend server is down, overloaded, or returning malformed responses.

🛡️ Security Implications

Repeated 502 errors may indicate a DDoS attack overwhelming the backend. Monitor backend health and implement circuit breakers.

🔍 Common Causes

Backend server crashed, PHP-FPM process died, upstream timeout, firewall blocking backend, DNS resolution failure, or backend overloaded.

🔧 How to Fix

Check backend server status. Restart PHP-FPM/application server. Increase proxy timeout values. Check backend firewall rules. Monitor backend memory and CPU.

🖥️ How to Check

curl -I -o /dev/null -w "%{http_code}" https://example.com