Troubleshoot 502 errors
Updated
❗
Bad Gateway.
A 502 Bad Gateway means a server that forwards requests got an invalid or empty answer from the server behind it. On fortrabbit, failing PHP processes show as 503 or 504, so a 502 is rare.
Where a 502 comes from
| Seen | Likely source |
|---|---|
| A Cloudflare or CDN error page | The CDN could not get a valid answer from fortrabbit. Check the domain's DNS and TLS settings in Cloudflare |
| The fortrabbit 502 page | A part of the platform got no valid answer from the environment |
| The app's own error page | The app calls another service that failed, and passes the 502 on |
A PHP process that crashes or runs too long answers with a 503 or a 504. Check those pages first when the app itself is the suspect.
What to check
- The logs of the environment at the time of the error.
- The metrics: a 502 together with OOM kills or a jump in PHP response time points to the app.
When the 502 stays and the logs show nothing, check the fortrabbit status page for incidents.