Skip to content

502 Bad Gateway

A Bad Gateway error happens when the PHP-FPM container fails to provide a valid response to the upstream server. While server-side resource issues are common, 502s can also happen due to front-end or development changes.

Common causes

  • Code or script issues – inefficient scripts, heavy database queries, or new themes/plugins that generate long-running requests can block the backend and exceed configured timeouts.
  • Resource limitations – insufficient CPU, RAM, or disk I/O on the backend server, often occurring as websites grow and existing hosting plans become insufficient.
  • Poor configuration - incorrect or untested adjustments in configuration files (such as .htaccess, Nginx server blocks, PHP-FPM pool settings, or php.ini) can break communication between Nginx and PHP-FPM

Troubleshooting

To re-enable connection with the PHP container, you need to restart it.

  1. Access the cloud panel and head to your Website↗
  2. In the horizontal menu bar at the top, click Advanced and select Developer tools
  3. In the first section and third row under Restart PHP container press Restart.

TIP

Restarting the PHP container may provide a temporary fix, but it is strongly recommended to identify and resolve the root cause, as 502 errors should not occur under normal operations.

Released under the MIT License.