A 502 Bad Gateway error occurs when one server (acting as a gateway or proxy) receives an invalid or no response from another server upstream in the request chain. For most websites, this means your web server tried to fetch data from an application server, database, or CDN but got garbage back or timed out waiting. Common causes include server overload where the application server is maxed out on CPU or memory and can't respond in time, PHP-FPM or application timeouts where your backend process takes longer than the gateway's patience threshold (often 60–120 seconds), proxy misconfigurations in reverse proxies like Nginx or Cloudflare, and upstream server crashes where the application layer simply dies mid-request. We also see 502s during deployments when the old process shuts down before the new one binds to the socket. From an SEO perspective, 502 errors are treated as temporary failures. Google will retry the URL multiple times over hours or days before considering it a real problem. If your 502s resolve within a few hours, you typically see no ranking impact. If they persist for days, Google may start dropping pages from the index or deprioritizing your domain for crawling. The fix depends on the cause. Check server logs (access logs and error logs) to identify what upstream failed. If it's load-related, you need vertical scaling (more RAM/CPU) or horizontal scaling (more application servers behind a load balancer). If it's timeout-related, increase gateway timeout settings and optimize slow database queries or API calls. If it's deployment-related, implement zero-downtime deployment strategies with health checks. At Ottawa SEO, when a client's site throws 502s, we immediately check uptime monitors and server logs to distinguish between a one-off glitch and a systemic problem. For ecommerce clients, even a 15-minute 502 incident during business hours can cost thousands in revenue, so we recommend monitoring tools like UptimeRobot or Pingdom with 1-minute check intervals and SMS alerts to the hosting team.