Cookies ahead

Our support chat tool "Intercom" would like to collect some more data on you. See the related link for more details.

Docs

Troubleshoot 502 errors

Bad Gateway.

502 Bad Gateway errors occur when a gateway receives an invalid or empty response from an upstream server. Here's how to troubleshoot and resolve them on fortrabbit.

  • 502 errors will usually be shown on screen immediately
  • 502 errors often occur after code or configuration changes
  • 502 errors are sometimes just printed as a "service unavailable" message, check the browser's developer tools for the response's HTTP status code to be sure this is indeed a 502 error
  • 502 errors here are often rendered using a fortrabbit error page template

A 502 means a gateway received an invalid or empty response from upstream. Most PHP-FPM problems on fortrabbit — the process not running, overloaded, or timing out — surface as a 503 or 504, not a 502. Check those first when the PHP engine is the suspect.

In some cases this is not a server issue, but something with your code and configuration. Good news is that they are mostly easy to debug for you.

Check the logs

Examine the logs of your environment. See here. There you'll likely find the error message and where the application exited. Compare this with your local development environment and see if it fails the same way. Review your latest code changes.

It could also be something on our side

It is also possible that this error is caused by a network, hardware or configuration issue on our side, your hosting provider. Please check our status page at status.fortrabbit.com if there are any ongoing maintenance windows or service issues known.

Written by a human. Review, grammar checks and typo fixes by AI.

AI use & editorial processEdit on GitHub ↗