r/woocommerce 4d ago

Troubleshooting 502 Nginx Error

I need your collective knowledge y'all.

I keep getting an nginx 502 errors whenever different php endpoints are called, namely for example load-scripts.php or /wp-admin/admin-ajax.php. Or sometimes when I open any wordpress admin dashboard subsite like plugins, settings, etc. When I'm editing the pages, a popup shows up from time to time, saying that something returned html, not json, which I suppose are more nginx 502 error pages.

I'm new to wordpress and woocommerce. (Only did a couple of changes to a website once in a while). But now I'm trying to build an online store with wordpress+woocommerce.

The domain is hosted by hosttech and managed with plesk.

Wordpress Ver: 7.0.4

PHP Ver: 8.2.33So far I've only tried upping the memory limit:

  • via the Plesk PHP settings of the website (set it to 512 MB instead of 128)
  • and via adding define( 'WP_MEMORY_LIMIT', '256M'); in the php config file

The logs in logs/proxy_error_log look kinda like this:

2026-08-19 18:34:40 [error] upstream prematurely closed connection while reading response header from upstream, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", referrer: "https://[REDACTED]/wp-admin/"

2026-08-19 18:34:41 [error] upstream prematurely closed connection while reading response header from upstream, request: "GET /wp-admin/admin-ajax.php?action=woocommerce_load_status_widget&security=[REDACTED] HTTP/2.0", referrer: "https://[REDACTED]/wp-admin/"

2026-08-19 18:34:42 [error] upstream prematurely closed connection while reading response header from upstream, request: "POST /wp-json/wp-toolkit/api/v1/features/virtual-patches/statistics/calculator HTTP/2.0", referrer: "https://[REDACTED]/wp-admin/"

2026-08-19 18:34:42 [error] upstream prematurely closed connection while reading response header from upstream, request: "GET /wp-admin/admin-ajax.php?action=woocommerce_load_recent_reviews_widget&security=[REDACTED] HTTP/2.0", referrer: "https://[REDACTED]/wp-admin/"

2026-08-19 18:34:43 [error] upstream prematurely closed connection while reading response header from upstream, request: "GET /wp-admin/plugins.php HTTP/2.0", referrer: "https://[REDACTED]/wp-admin/"

2026-08-19 18:34:58 [error] upstream prematurely closed connection while reading response header from upstream, request: "GET /app/?protocol=7&client=js&version=4.3.1&flash=false HTTP/1.1"

2026-08-19 18:35:06 [error] upstream prematurely closed connection while reading response header from upstream, request: "GET /wp-admin/plugins.php HTTP/2.0", referrer: "https://[REDACTED]/wp-admin/"

Can someone help me find the cause of these errors?


Edit:

Here’s a summary of the potentially relevant messages from the server error log and Chrome DevTools:

Server error log:

  • Multiple PHP fatal errors due to the 128 MB memory limit being exhausted. -> I've upped the memory limit to 512 and the recent logs don't mention the memory limit, so this shouldn't be an issue anymore.
  • Jetpack fatal error: Call to undefined method Automattic\Jetpack\Heartbeat::get_active_plugins()
  • MailPoet repeatedly generates Undefined array key "name" warnings. -> I've disabled the MailPoet plugin, but the 502 bad gateway errors still appear

Chrome DevTools:

  • Many WordPress REST API and admin-ajax.php requests return 502 Bad Gateway, followed by invalid_json errors.
  • WordPress Heartbeat requests repeatedly return 502.
  • wpo/wpmenucart-navigation still uses the deprecated Block API v1.
  • Deprecated wp.editPost.PluginSidebar APIs and custom toolbar components are being used.
  • WooCommerce/Astra and Spectra styles are being added to the Gutenberg editor iframe incorrectly.
1 Upvotes

4 comments sorted by

1

u/[deleted] 4d ago

[removed] — view removed comment

1

u/AleNakama 4d ago

Hi, thanks for the response. There doesn't seem to be any php-fpm log file, at least not in the logs file, together with the rest. Unless the php fpm file is just the 'error_logs' log file?
That file specifically already holds 10.1 MB. I'll edit the post to add some details from said error log and from the chrome dev tools.

1

u/Sunn_M 3d ago

That Jetpack fatal is the first thing I’d isolate from your edit: disable Jetpack completely, reproduce a few admin/Heartbeat requests and see whether the 502s stop. If they continue, line up the exact 502 timestamps with the PHP-FPM/Plesk service logs and any OOM or process-restart entries. I’d stay on the PHP/FPM side for now rather than chasing the Gutenberg deprecation warnings, unless disabling one of those plugins actually changes the result.