{"id":356,"date":"2026-11-17T13:05:51","date_gmt":"2026-11-17T20:05:51","guid":{"rendered":"https:\/\/hostandtech.com\/kb\/?p=356"},"modified":"2026-11-17T13:05:51","modified_gmt":"2026-11-17T20:05:51","slug":"plesk-502-bad-gateway-nginx","status":"publish","type":"post","link":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/","title":{"rendered":"502 Bad Gateway in Plesk: How to Find and Fix the Cause (nginx, PHP-FPM, Apache)"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>A 502 Bad Gateway on a Plesk site means nginx, which answers every request first, couldn&#8217;t get a usable reply from the service behind it: PHP-FPM or Apache. The domain&#8217;s nginx log names the cause in one line, so start there: <code class=\"\" data-line=\"\">\/var\/www\/vhosts\/system\/example.com\/logs\/proxy_error_log<\/code>, or <strong>Websites &amp; Domains &gt; example.com &gt; Logs<\/strong> in Plesk.<\/p>\n<p>This guide is for VPS and dedicated server owners running Plesk Obsidian on Linux (AlmaLinux, Ubuntu or Debian) who see &#8220;502 Bad Gateway&#8221; with &#8220;nginx&#8221; underneath, on one site or on all of them. You&#8217;ll match the log line to its cause, apply the fix for that cause, and check that it holds under load. Restarting services clears most 502s for a few minutes; the log tells you whether they&#8217;ll be back tonight.<\/p>\n<h2>What causes 502 Bad Gateway in Plesk<\/h2>\n<p>With the default setup, nginx passes PHP requests either straight to a PHP-FPM pool for the domain or to Apache (listening on ports 7080 and 7081), which then calls PHP-FPM. A 502 means one of those links broke. The log line tells you which:<\/p>\n<figure class=\"wp-block-image\"><img src=\"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/11\/plesk-502-request-path-logs.webp\" alt=\"Request path in Plesk from browser to nginx to Apache and PHP-FPM, showing where each 502 error is logged\" width=\"1000\" height=\"620\" loading=\"lazy\" decoding=\"async\"><figcaption>Where a request can break in Plesk, and which log records it.<\/figcaption><\/figure>\n<table>\n<thead>\n<tr>\n<th>Log line contains<\/th>\n<th>What it means<\/th>\n<th>Go to<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code class=\"\" data-line=\"\">php-fpm.sock failed (11: Resource temporarily unavailable)<\/code><\/td>\n<td>The domain&#8217;s PHP pool is full<\/td>\n<td>Fix 2<\/td>\n<\/tr>\n<tr>\n<td><code class=\"\" data-line=\"\">php-fpm.sock failed (2: No such file or directory)<\/code><\/td>\n<td>The pool isn&#8217;t running or its config is missing<\/td>\n<td>Fix 3<\/td>\n<\/tr>\n<tr>\n<td><code class=\"\" data-line=\"\">(111: Connection refused) while connecting to upstream<\/code><\/td>\n<td>Apache is down<\/td>\n<td>Fix 4<\/td>\n<\/tr>\n<tr>\n<td><code class=\"\" data-line=\"\">upstream prematurely closed connection<\/code><\/td>\n<td>PHP died while building the page<\/td>\n<td>Fix 5<\/td>\n<\/tr>\n<tr>\n<td><code class=\"\" data-line=\"\">upstream sent too big header<\/code><\/td>\n<td>The response headers don&#8217;t fit nginx&#8217;s buffer<\/td>\n<td>Fix 6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How to fix 502 Bad Gateway in Plesk<\/h2>\n<h3>Fix 1: Read the domain&#8217;s proxy_error_log<\/h3>\n<p>Connect over SSH as root and read the last lines for the affected domain:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-1\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-1'><code class=\"\" data-line=\"\">tail -n 50 \/var\/www\/vhosts\/system\/example.com\/logs\/proxy_error_log<\/code><\/pre>\n<\/div>\n<p>If every site on the server shows 502, check the server-wide log too:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-2\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-2'><code class=\"\" data-line=\"\">tail -n 50 \/var\/log\/nginx\/error.log<\/code><\/pre>\n<\/div>\n<p>Without SSH, open <strong>Websites &amp; Domains &gt; example.com &gt; Logs<\/strong> and filter for nginx errors. Match the message to the table above. If the log is empty at the time of the error, reload the page once and look again; Plesk only writes the line when the request fails.<\/p>\n<h3>Fix 2: The PHP-FPM pool is full (max_children)<\/h3>\n<p>Each Plesk domain on PHP-FPM gets its own pool with a cap on how many PHP processes can run at once. When every process is busy, new requests are refused and nginx shows 502. Confirm it in that PHP version&#8217;s FPM log (replace 83 with the version the site uses):<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-3\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-3'><code class=\"\" data-line=\"\">grep max_children \/var\/log\/plesk-php83-fpm\/error.log | tail -n 5<\/code><\/pre>\n<\/div>\n<p>A line like <code class=\"\" data-line=\"\">WARNING: [pool example.com] server reached max_children setting (5), consider raising it<\/code> confirms it. The default limit on many installs is low enough that one busy WooCommerce store hits it.<\/p>\n<ol>\n<li>In Plesk, go to <strong>Websites &amp; Domains &gt; example.com &gt; PHP<\/strong> (PHP Settings).<\/li>\n<li>Under performance settings, raise <strong>pm.max_children<\/strong>. Doubling it is a reasonable first step.<\/li>\n<li>Click <strong>Apply<\/strong>. Plesk reloads the pool for you.<\/li>\n<\/ol>\n<p>Before going higher, check the RAM. Each PHP process for a typical WordPress site uses 60 to 150 MB, and this prints the real average on your server:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-4\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-4'><code class=\"\" data-line=\"\">ps -o rss= -C php-fpm | awk &#039;{s+=$1; n++} END {printf &quot;%d processes, %.0f MB average&#092;n&quot;, n, s\/n\/1024}&#039;<\/code><\/pre>\n<\/div>\n<p>Divide the RAM you can spare for PHP by that average to get a safe ceiling for all pools combined. Set it higher than the RAM allows and the kernel starts killing processes instead, which is harder to diagnose: see <a href=\"https:\/\/hostandtech.com\/kb\/linux\/linux-oom-killer-how-to-fix\/\">how to fix the Linux OOM killer<\/a>. Often the better fix is fewer slow requests. Page caching and blocking bots on <code class=\"\" data-line=\"\">xmlrpc.php<\/code> and <code class=\"\" data-line=\"\">wp-login.php<\/code> cut the number of PHP processes a site needs.<\/p>\n<h3>Fix 3: The PHP-FPM socket is missing<\/h3>\n<p>&#8220;No such file or directory&#8221; means nginx looked for the pool&#8217;s socket and it wasn&#8217;t there. Usually the PHP-FPM service for that version has stopped, or the pool config wasn&#8217;t written after a PHP version change. List the handlers and restart the one the site uses:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-5\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-5'><code class=\"\" data-line=\"\">plesk bin php_handler --list | grep fpm\nsystemctl restart plesk-php83-fpm\nsystemctl status plesk-php83-fpm --no-pager<\/code><\/pre>\n<\/div>\n<p>If the socket still doesn&#8217;t appear, have Plesk rebuild the domain&#8217;s web configuration:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-6\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-6'><code class=\"\" data-line=\"\">plesk repair web example.com -y<\/code><\/pre>\n<\/div>\n<p>A related case: a site switched from &#8220;FPM application served by Apache&#8221; to &#8220;FPM application served by nginx&#8221; in <a href=\"https:\/\/hostandtech.com\/kb\/plesk-linux\/how-to-manage-php-versions-in-plesk\/\">PHP settings<\/a> can break plugins that expect Apache. If the 502 started right after that change, switch the handler back.<\/p>\n<h3>Fix 4: Apache isn&#8217;t running<\/h3>\n<p>&#8220;Connection refused&#8221; on port 7080 or 7081 means nginx tried to hand the request to Apache and nothing answered. Check the service (it&#8217;s <code class=\"\" data-line=\"\">apache2<\/code> on Ubuntu and Debian, <code class=\"\" data-line=\"\">httpd<\/code> on AlmaLinux and Rocky):<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-7\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-7'><code class=\"\" data-line=\"\">systemctl status apache2 --no-pager\napachectl -t\nsystemctl start apache2<\/code><\/pre>\n<\/div>\n<p><code class=\"\" data-line=\"\">apachectl -t<\/code> shows the config error that stops Apache from starting, usually from a manual edit or a half-applied update. If the error points to a Plesk-generated file, rebuild them all:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-8\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-8'><code class=\"\" data-line=\"\">plesk repair web -y<\/code><\/pre>\n<\/div>\n<p><strong>Warning:<\/strong> the server-wide repair regenerates the web configuration for every domain and restarts the web services, so every site blinks for a few seconds. Run it outside business hours if the server hosts customers. If nginx itself won&#8217;t start afterwards, see <a href=\"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-nginx-failed-to-start-fix\/\">Plesk nginx failed to start<\/a>.<\/p>\n<h3>Fix 5: PHP closes the connection mid-request<\/h3>\n<p>&#8220;upstream prematurely closed connection while reading response header&#8221; means PHP started on the request and then died: a fatal error, the memory limit or a crashed extension. The reason is in the domain&#8217;s error log, written at the same second:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-9\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-9'><code class=\"\" data-line=\"\">grep -iE &#039;fatal|memory|segfault&#039; \/var\/www\/vhosts\/system\/example.com\/logs\/error_log | tail -n 10<\/code><\/pre>\n<\/div>\n<p>&#8220;Allowed memory size of &#8230; bytes exhausted&#8221; means raising <code class=\"\" data-line=\"\">memory_limit<\/code> in the domain&#8217;s PHP settings, or finding the plugin that uses it. A segfault after a PHP upgrade usually means an extension (ionCube, an old opcache setting) that doesn&#8217;t match the new version. Uploads that fail on size show a different error; that one is covered in <a href=\"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-413-request-entity-too-large\/\">413 Request Entity Too Large in Plesk<\/a>.<\/p>\n<h3>Fix 6: upstream sent too big header<\/h3>\n<p>Some apps send large cookies or many headers (WordPress with several security or multilingual plugins is a regular case), and the reply doesn&#8217;t fit nginx&#8217;s default buffer. Raise it for the one domain in <strong>Websites &amp; Domains &gt; example.com &gt; Apache &amp; nginx Settings<\/strong>, under <strong>Additional nginx directives<\/strong>:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-10\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-10'><code class=\"\" data-line=\"\">proxy_buffer_size 32k;\nproxy_buffers 8 16k;\nfastcgi_buffer_size 32k;\nfastcgi_buffers 8 16k;<\/code><\/pre>\n<\/div>\n<p>Click <strong>OK<\/strong>. Plesk tests the config before applying it and refuses to save directives nginx won&#8217;t accept, so a typo here can&#8217;t take the site down.<\/p>\n<h2>How to prevent it<\/h2>\n<ul>\n<li><strong>Read the logs weekly.<\/strong> Uptime monitors only see the outage. A quick look at <code class=\"\" data-line=\"\">grep -c &#039;max_children&#039; \/var\/log\/plesk-php*-fpm\/error.log<\/code> shows a pool filling up weeks before visitors see a 502.<\/li>\n<li><strong>Size pools for RAM.<\/strong> Add up max_children across busy domains and compare it with free memory, especially after adding a site.<\/li>\n<li><strong>Cache pages<\/strong> so most visits never touch PHP.<\/li>\n<li><strong>Test after PHP and Plesk updates.<\/strong> Most socket and extension 502s appear in the hour after an upgrade. Our guide to <a href=\"https:\/\/hostandtech.com\/kb\/plesk-linux\/how-to-update-plesk-on-linux\/\">updating Plesk on Linux<\/a> includes a post-update check.<\/li>\n<\/ul>\n<p>If a site still fills its pool after caching, the server is short of memory. Our <a href=\"https:\/\/hostandtech.com\/vps-ssd-servers\">SSD VPS plans<\/a> let you add memory without moving the site.<\/p>\n<div class=\"ht-faq-section\">\n<h2>Frequently Asked Questions<\/h2>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">What does 502 Bad Gateway mean in Plesk?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>nginx received the request but got no valid response from the service behind it, which is PHP-FPM or Apache. The domain\u2019s proxy_error_log says which one failed and why, usually a full PHP pool, a stopped service or a PHP crash.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">Where is the nginx error log for a domain in Plesk?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>It\u2019s at \/var\/www\/vhosts\/system\/example.com\/logs\/proxy_error_log, with the server-wide log at \/var\/log\/nginx\/error.log. In the Plesk panel, open Websites &amp; Domains, then the domain\u2019s Logs page and filter for nginx errors.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">Is a 502 error the same as a 504 Gateway Timeout?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>No. A 502 means the backend refused or broke the connection, while a 504 means it was still working when nginx stopped waiting. A 504 points at slow scripts or timeouts; a 502 points at a full pool, a stopped service or a crash.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">Should I turn off nginx proxy mode to fix a 502?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>It usually just moves the error. Apache then returns 503 or times out for the same underlying reason, such as a full PHP-FPM pool. Fix the cause shown in proxy_error_log and keep nginx in front.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">How high should I set pm.max_children in Plesk?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>Measure the average PHP-FPM process size, then divide the RAM you can spare for PHP by that number to get a ceiling for all pools combined. Raising it beyond what the RAM allows trades 502 errors for out-of-memory crashes.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A 502 in Plesk means nginx got no usable reply from PHP-FPM or Apache. Read one log line to see which, then fix that cause: a full PHP pool, a missing socket, a stopped Apache, a PHP crash or a header that is too big.<\/p>\n","protected":false},"author":1,"featured_media":348,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[61],"tags":[154,496,62,156,194],"class_list":["post-356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plesk-linux","tag-nginx","tag-php-fpm","tag-plesk","tag-plesk-linux","tag-plesk-obsidian"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>502 Bad Gateway in Plesk: Find the Cause and Fix It<\/title>\n<meta name=\"description\" content=\"Fix 502 Bad Gateway in Plesk: read proxy_error_log, then fix a full PHP-FPM pool, a missing socket, a stopped Apache, PHP crashes or nginx header buffers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"502 Bad Gateway in Plesk: Find the Cause and Fix It\" \/>\n<meta property=\"og:description\" content=\"Fix 502 Bad Gateway in Plesk: read proxy_error_log, then fix a full PHP-FPM pool, a missing socket, a stopped Apache, PHP crashes or nginx header buffers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/\" \/>\n<meta property=\"og:site_name\" content=\"Host And Tech knowledge base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/stshostandtech\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-17T20:05:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/11\/plesk-502-bad-gateway-nginx.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@stshostandtech\" \/>\n<meta name=\"twitter:site\" content=\"@stshostandtech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/person\\\/b6fa79c48ddaba71af32e395c5b017ee\"},\"headline\":\"502 Bad Gateway in Plesk: How to Find and Fix the Cause (nginx, PHP-FPM, Apache)\",\"datePublished\":\"2026-11-17T20:05:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/\"},\"wordCount\":1358,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/plesk-502-bad-gateway-nginx.webp\",\"keywords\":[\"nginx\",\"php-fpm\",\"plesk\",\"plesk linux\",\"plesk-obsidian\"],\"articleSection\":[\"Plesk on Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/\",\"name\":\"502 Bad Gateway in Plesk: Find the Cause and Fix It\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/plesk-502-bad-gateway-nginx.webp\",\"datePublished\":\"2026-11-17T20:05:51+00:00\",\"description\":\"Fix 502 Bad Gateway in Plesk: read proxy_error_log, then fix a full PHP-FPM pool, a missing socket, a stopped Apache, PHP crashes or nginx header buffers.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/#primaryimage\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/plesk-502-bad-gateway-nginx.webp\",\"contentUrl\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/plesk-502-bad-gateway-nginx.webp\",\"width\":1200,\"height\":630,\"caption\":\"502 Bad Gateway in Plesk: broken link between nginx and Apache or PHP-FPM, with the proxy_error_log path\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/plesk-linux\\\/plesk-502-bad-gateway-nginx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"502 Bad Gateway in Plesk: How to Find and Fix the Cause (nginx, PHP-FPM, Apache)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\",\"name\":\"Host And Tech knowledge base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\",\"name\":\"Host And Tech knowledge base\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/logo-dark.png\",\"contentUrl\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/logo-dark.png\",\"width\":1134,\"height\":395,\"caption\":\"Host And Tech knowledge base\"},\"image\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/stshostandtech\",\"https:\\\/\\\/x.com\\\/stshostandtech\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/person\\\/b6fa79c48ddaba71af32e395c5b017ee\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/hostandtech.com\\\/kb\"],\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/author\\\/admin_fjj7qydm\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"502 Bad Gateway in Plesk: Find the Cause and Fix It","description":"Fix 502 Bad Gateway in Plesk: read proxy_error_log, then fix a full PHP-FPM pool, a missing socket, a stopped Apache, PHP crashes or nginx header buffers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/","og_locale":"en_US","og_type":"article","og_title":"502 Bad Gateway in Plesk: Find the Cause and Fix It","og_description":"Fix 502 Bad Gateway in Plesk: read proxy_error_log, then fix a full PHP-FPM pool, a missing socket, a stopped Apache, PHP crashes or nginx header buffers.","og_url":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/","og_site_name":"Host And Tech knowledge base","article_publisher":"https:\/\/www.facebook.com\/stshostandtech","article_published_time":"2026-11-17T20:05:51+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/11\/plesk-502-bad-gateway-nginx.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@stshostandtech","twitter_site":"@stshostandtech","twitter_misc":{"Written by":"admin","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/#article","isPartOf":{"@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/"},"author":{"name":"admin","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/person\/b6fa79c48ddaba71af32e395c5b017ee"},"headline":"502 Bad Gateway in Plesk: How to Find and Fix the Cause (nginx, PHP-FPM, Apache)","datePublished":"2026-11-17T20:05:51+00:00","mainEntityOfPage":{"@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/"},"wordCount":1358,"commentCount":0,"publisher":{"@id":"https:\/\/hostandtech.com\/kb\/#organization"},"image":{"@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/11\/plesk-502-bad-gateway-nginx.webp","keywords":["nginx","php-fpm","plesk","plesk linux","plesk-obsidian"],"articleSection":["Plesk on Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/","url":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/","name":"502 Bad Gateway in Plesk: Find the Cause and Fix It","isPartOf":{"@id":"https:\/\/hostandtech.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/#primaryimage"},"image":{"@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/11\/plesk-502-bad-gateway-nginx.webp","datePublished":"2026-11-17T20:05:51+00:00","description":"Fix 502 Bad Gateway in Plesk: read proxy_error_log, then fix a full PHP-FPM pool, a missing socket, a stopped Apache, PHP crashes or nginx header buffers.","breadcrumb":{"@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/#primaryimage","url":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/11\/plesk-502-bad-gateway-nginx.webp","contentUrl":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/11\/plesk-502-bad-gateway-nginx.webp","width":1200,"height":630,"caption":"502 Bad Gateway in Plesk: broken link between nginx and Apache or PHP-FPM, with the proxy_error_log path"},{"@type":"BreadcrumbList","@id":"https:\/\/hostandtech.com\/kb\/plesk-linux\/plesk-502-bad-gateway-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hostandtech.com\/kb\/"},{"@type":"ListItem","position":2,"name":"502 Bad Gateway in Plesk: How to Find and Fix the Cause (nginx, PHP-FPM, Apache)"}]},{"@type":"WebSite","@id":"https:\/\/hostandtech.com\/kb\/#website","url":"https:\/\/hostandtech.com\/kb\/","name":"Host And Tech knowledge base","description":"","publisher":{"@id":"https:\/\/hostandtech.com\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hostandtech.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hostandtech.com\/kb\/#organization","name":"Host And Tech knowledge base","url":"https:\/\/hostandtech.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/05\/logo-dark.png","contentUrl":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/05\/logo-dark.png","width":1134,"height":395,"caption":"Host And Tech knowledge base"},"image":{"@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/stshostandtech","https:\/\/x.com\/stshostandtech"]},{"@type":"Person","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/person\/b6fa79c48ddaba71af32e395c5b017ee","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/hostandtech.com\/kb"],"url":"https:\/\/hostandtech.com\/kb\/author\/admin_fjj7qydm\/"}]}},"_links":{"self":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":1,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"predecessor-version":[{"id":361,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/356\/revisions\/361"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/media\/348"}],"wp:attachment":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}