{"id":694,"date":"2026-11-12T09:15:00","date_gmt":"2026-11-12T09:15:00","guid":{"rendered":"https:\/\/getserverexplorer.app\/?p=694"},"modified":"2026-11-10T21:54:08","modified_gmt":"2026-11-10T21:54:08","slug":"how-to-fix-502-bad-gateway-on-nginx-5-checks","status":"publish","type":"post","link":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/","title":{"rendered":"How to Fix 502 Bad Gateway on Nginx (5 Checks)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your website worked yesterday. Today, it shows <strong>502 Bad Gateway<\/strong>. If you host a Node.js, Python, or PHP application behind Nginx, the problem is often between Nginx and the service handling your requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are five checks to find the cause without blindly restarting everything.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Does 502 Bad Gateway Mean?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Nginx often acts as a <strong>reverse proxy<\/strong>: it receives visitors&#8217; requests and forwards them to your application (the <em>upstream<\/em>). A 502 response means Nginx could not get a valid response from that upstream. The application might have stopped, the port might be wrong, or Nginx might be unable to access a Unix socket.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Check Whether Your Application Is Running<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start with the backend, not Nginx.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a systemd service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status my-app\nsudo journalctl -u my-app -n 50 --no-pager<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a Node.js app managed by PM2:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pm2 list\npm2 logs my-app --lines 50<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For Docker:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker ps -a\ndocker logs --tail 50 my-container<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the application is crashing, fix that first. Restarting Nginx will not repair a broken backend.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Verify the Upstream Port<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Suppose your Nginx configuration forwards requests to <code>127.0.0.1:3000<\/code>. Check whether anything is listening there:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ss -ltnp | grep ':3000'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then test the backend directly <strong>from the server<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -i http:\/\/127.0.0.1:3000\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A <code>404<\/code> from your app can still prove the upstream is reachable; <code>Connection refused<\/code> suggests nothing is listening at that address and port. A timeout may indicate a different network or application issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the backend runs in Docker, confirm the port mapping and whether Nginx is on the host or inside another container. <code>localhost<\/code> inside a container refers to that container, not the host or another container.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"1c2125\" data-has-transparency=\"true\" style=\"--dominant-color: #1c2125;\" loading=\"lazy\" decoding=\"async\" width=\"2024\" height=\"1624\" src=\"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-07-a-22.25.45.webp\" alt=\"Server Explorer Ports monitor showing listening ports and associated Linux processes\" class=\"wp-image-682 has-transparency\" srcset=\"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-07-a-22.25.45.webp 2024w, https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-07-a-22.25.45-300x241.webp 300w, https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-07-a-22.25.45-1024x822.webp 1024w, https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-07-a-22.25.45-768x616.webp 768w, https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-07-a-22.25.45-1536x1232.webp 1536w\" sizes=\"auto, (max-width: 2024px) 100vw, 2024px\" \/><\/figure>\n\n\n<div class=\"section-cta article-cta\" lang=\"en\">\n <svg class=\"cta-network\" viewBox=\"0 0 1000 320\" fill=\"none\" aria-hidden=\"true\" focusable=\"false\" preserveAspectRatio=\"xMidYMid slice\">\n <g class=\"network-routes\" stroke=\"currentColor\" stroke-width=\"1\">\n  <path d=\"M1000 40H820L740 120H640L570 190H420\"\/><path d=\"M1000 130H880L780 230H630L560 300H390\"\/>\n  <path d=\"M1000 280H840L760 200V80L680 0\"\/><path d=\"M930 0V75L850 155H710L630 235H520\"\/>\n  <path d=\"M530 0L610 80H710L790 0\"\/><path d=\"M1000 190H940L865 265V320\"\/>\n <\/g>\n <g class=\"network-signal\" stroke=\"currentColor\" stroke-width=\"2\" stroke-dasharray=\"32 720\">\n  <path d=\"M1000 40H820L740 120H640L570 190H420\"\/><path d=\"M1000 130H880L780 230H630L560 300H390\"\/>\n <\/g>\n <g class=\"network-nodes\" stroke=\"currentColor\" stroke-width=\"1.2\">\n  <rect x=\"728\" y=\"108\" width=\"24\" height=\"24\" rx=\"7\"\/><rect x=\"768\" y=\"218\" width=\"24\" height=\"24\" rx=\"7\"\/>\n  <rect x=\"838\" y=\"143\" width=\"24\" height=\"24\" rx=\"7\"\/><circle cx=\"610\" cy=\"80\" r=\"5\"\/><circle cx=\"630\" cy=\"235\" r=\"5\"\/><circle cx=\"865\" cy=\"265\" r=\"5\"\/>\n <\/g>\n <g fill=\"currentColor\"><circle cx=\"740\" cy=\"120\" r=\"3\"\/><circle cx=\"780\" cy=\"230\" r=\"3\"\/><circle cx=\"850\" cy=\"155\" r=\"3\"\/><\/g>\n<\/svg>\n <div class=\"section-cta-copy\">\n  <span class=\"cta-eyebrow\"><span class=\"cta-connection\" aria-hidden=\"true\"><\/span>Server Explorer<\/span>\n  <h3>Bring your servers into focus.<\/h3>\n  <p>A desktop app for macOS and Windows. Connect over SSH.<\/p> <\/div>\n <a class=\"button cta-button\" data-download-auto data-download-mac=\"https:\/\/apps.apple.com\/bj\/app\/server-files-explorer\/id6474502110?l=fr-FR&#038;mt=12\" data-download-windows=\"https:\/\/apps.microsoft.com\/detail\/9nrb68w7pjg8?gl=US&#038;hl=en-US\" href=\"https:\/\/getserverexplorer.app\/#download\">Download<span class=\"cta-arrow\" aria-hidden=\"true\">\u2197<\/span><\/a>\n<\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\">3. Read the Nginx Error Logs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The error log usually gives you the strongest clue:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tail -n 80 \/var\/log\/nginx\/error.log<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or inspect the service journal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo journalctl -u nginx -n 80 --no-pager<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common messages include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>connect() failed (111: Connection refused)<\/code><\/strong>: the upstream is not accepting connections at the configured endpoint.<\/li>\n\n\n\n<li><strong><code>upstream timed out<\/code><\/strong>: the backend took too long to respond; check performance and timeout settings rather than assuming it is stopped.<\/li>\n\n\n\n<li><strong><code>connect() to unix:... failed (13: Permission denied)<\/code><\/strong>: Nginx cannot access the upstream socket, often due to ownership, permissions, or security policy.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Log locations can differ across distributions and custom Nginx configurations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Check the Nginx Proxy Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open the relevant site configuration, commonly under <code>\/etc\/nginx\/sites-enabled\/<\/code> or <code>\/etc\/nginx\/conf.d\/<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For an HTTP backend on port 3000, a minimal proxy block looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>location \/ {\n    proxy_pass http:\/\/127.0.0.1:3000;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header X-Forwarded-Proto $scheme;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check that the hostname, port, and protocol match your application. If Nginx proxies to a named upstream, inspect that upstream&#8217;s server definitions too.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before applying changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nginx -t<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the configuration test succeeds, reload Nginx:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do not reload a broken configuration or change production settings without a backup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. Check Unix Socket Permissions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Some applications use a Unix socket instead of a TCP port, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>proxy_pass http:\/\/unix:\/run\/my-app\/app.sock:;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the logs mention <strong>permission denied<\/strong>, inspect the socket and its parent directories:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ls -l \/run\/my-app\/app.sock\nsudo namei -l \/run\/my-app\/app.sock<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The Nginx worker user needs appropriate access to the socket and permission to traverse its parent directories. Correct the application service&#8217;s socket ownership or group configuration rather than making the socket world-writable. On systems using SELinux or AppArmor, security policy may also block access.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshoot Nginx with Server Explorer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can run these commands over SSH, but switching between terminals, service lists, and log files slows down troubleshooting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With <strong><a href=\"https:\/\/getserverexplorer.app\">Server Explorer<\/a><\/strong>, you can connect to your Linux VPS and inspect relevant parts of your environment from one desktop interface:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Monitoring \u2192 Ports:<\/strong> see listening ports and their associated processes.<\/li>\n\n\n\n<li><strong>Monitoring \u2192 Processes:<\/strong> locate and inspect processes; stop one when appropriate.<\/li>\n\n\n\n<li><strong>Services:<\/strong> check and manage systemd services.<\/li>\n\n\n\n<li><strong>Integrated terminal:<\/strong> run <code>curl<\/code>, <code>journalctl<\/code>, or <code>nginx -t<\/code> without leaving the app.<\/li>\n\n\n\n<li><strong>Logs:<\/strong> inspect supported log sources in the interface.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Server Explorer does not automatically diagnose or fix every Nginx 502 error. It makes the underlying server state easier to inspect while you investigate.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"1f262b\" data-has-transparency=\"true\" style=\"--dominant-color: #1f262b;\" loading=\"lazy\" decoding=\"async\" width=\"2024\" height=\"1624\" src=\"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-10-a-22.42.43.webp\" alt=\"Inspecting Nginx eoor ogs using Server Explorer over SSH\" class=\"wp-image-695 has-transparency\" srcset=\"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-10-a-22.42.43.webp 2024w, https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-10-a-22.42.43-300x241.webp 300w, https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-10-a-22.42.43-1024x822.webp 1024w, https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-10-a-22.42.43-768x616.webp 768w, https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/Capture-decran-2026-11-10-a-22.42.43-1536x1232.webp 1536w\" sizes=\"auto, (max-width: 2024px) 100vw, 2024px\" \/><\/figure>\n\n\n<div class=\"section-cta article-cta\" lang=\"en\">\n <svg class=\"cta-network\" viewBox=\"0 0 1000 320\" fill=\"none\" aria-hidden=\"true\" focusable=\"false\" preserveAspectRatio=\"xMidYMid slice\">\n <g class=\"network-routes\" stroke=\"currentColor\" stroke-width=\"1\">\n  <path d=\"M1000 40H820L740 120H640L570 190H420\"\/><path d=\"M1000 130H880L780 230H630L560 300H390\"\/>\n  <path d=\"M1000 280H840L760 200V80L680 0\"\/><path d=\"M930 0V75L850 155H710L630 235H520\"\/>\n  <path d=\"M530 0L610 80H710L790 0\"\/><path d=\"M1000 190H940L865 265V320\"\/>\n <\/g>\n <g class=\"network-signal\" stroke=\"currentColor\" stroke-width=\"2\" stroke-dasharray=\"32 720\">\n  <path d=\"M1000 40H820L740 120H640L570 190H420\"\/><path d=\"M1000 130H880L780 230H630L560 300H390\"\/>\n <\/g>\n <g class=\"network-nodes\" stroke=\"currentColor\" stroke-width=\"1.2\">\n  <rect x=\"728\" y=\"108\" width=\"24\" height=\"24\" rx=\"7\"\/><rect x=\"768\" y=\"218\" width=\"24\" height=\"24\" rx=\"7\"\/>\n  <rect x=\"838\" y=\"143\" width=\"24\" height=\"24\" rx=\"7\"\/><circle cx=\"610\" cy=\"80\" r=\"5\"\/><circle cx=\"630\" cy=\"235\" r=\"5\"\/><circle cx=\"865\" cy=\"265\" r=\"5\"\/>\n <\/g>\n <g fill=\"currentColor\"><circle cx=\"740\" cy=\"120\" r=\"3\"\/><circle cx=\"780\" cy=\"230\" r=\"3\"\/><circle cx=\"850\" cy=\"155\" r=\"3\"\/><\/g>\n<\/svg>\n <div class=\"section-cta-copy\">\n  <span class=\"cta-eyebrow\"><span class=\"cta-connection\" aria-hidden=\"true\"><\/span>Server Explorer<\/span>\n  <h3>Bring your servers into focus.<\/h3>\n  <p>A desktop app for macOS and Windows. Connect over SSH.<\/p> <\/div>\n <a class=\"button cta-button\" data-download-auto data-download-mac=\"https:\/\/apps.apple.com\/bj\/app\/server-files-explorer\/id6474502110?l=fr-FR&#038;mt=12\" data-download-windows=\"https:\/\/apps.microsoft.com\/detail\/9nrb68w7pjg8?gl=US&#038;hl=en-US\" href=\"https:\/\/getserverexplorer.app\/#download\">Download<span class=\"cta-arrow\" aria-hidden=\"true\">\u2197<\/span><\/a>\n<\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\">Quick Checklist<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When Nginx returns a 502 error, work through this order:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Confirm the backend application is running.<\/li>\n\n\n\n<li>Check that the expected port or socket exists.<\/li>\n\n\n\n<li>Test the backend directly with <code>curl<\/code> when it uses HTTP.<\/li>\n\n\n\n<li>Read the Nginx error log for the exact failure.<\/li>\n\n\n\n<li>Validate the Nginx configuration and socket permissions before reloading.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The key is to find out why Nginx cannot reach its upstream, not simply restart services until the error disappears.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em><a href=\"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/10\/kill-process-on-port-linux\/\">How to Find and Kill a Process Using a Port on Linux<\/a><\/em> <\/li>\n\n\n\n<li><em><a href=\"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/01\/docker-container-keeps-restarting\/\">Docker Container Keeps Restarting? 5 Things to Check<\/a><\/em> <\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Your website worked yesterday. Today, it shows 502 Bad Gateway. If you host a Node.js, Python, or PHP application behind Nginx, the problem is often between Nginx and the service handling your requests. Here are five checks to find the cause without blindly restarting everything. What Does 502 Bad Gateway Mean? Nginx often acts as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":696,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[208,21],"tags":[],"class_list":["post-694","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-troubleshooting","category-vps-management"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Fix 502 Bad Gateway on Nginx (5 Checks) - Server Explorer<\/title>\n<meta name=\"description\" content=\"Getting a 502 Bad Gateway error on Nginx? Check your application, upstream port, Nginx logs, and proxy configuration to fix it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fix 502 Bad Gateway on Nginx (5 Checks) - Server Explorer\" \/>\n<meta property=\"og:description\" content=\"Getting a 502 Bad Gateway error on Nginx? Check your application, upstream port, Nginx logs, and proxy configuration to fix it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/\" \/>\n<meta property=\"og:site_name\" content=\"Server Explorer\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-12T09:15:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/fix-502-bad-gateway-nginx.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1672\" \/>\n\t<meta property=\"og:image:height\" content=\"941\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"darrellkidjo.dev\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@darrell_kidjo\" \/>\n<meta name=\"twitter:site\" content=\"@darrell_kidjo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"darrellkidjo.dev\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/\"},\"author\":{\"name\":\"darrellkidjo.dev\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#\\\/schema\\\/person\\\/20f67c2affa11693453fec19477c9ec8\"},\"headline\":\"How to Fix 502 Bad Gateway on Nginx (5 Checks)\",\"datePublished\":\"2026-11-12T09:15:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/\"},\"wordCount\":670,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/getserverexplorer.app\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/fix-502-bad-gateway-nginx.webp\",\"articleSection\":[\"Linux \\\/ Troubleshooting\",\"VPS Management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/\",\"url\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/\",\"name\":\"How to Fix 502 Bad Gateway on Nginx (5 Checks) - Server Explorer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/getserverexplorer.app\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/fix-502-bad-gateway-nginx.webp\",\"datePublished\":\"2026-11-12T09:15:00+00:00\",\"description\":\"Getting a 502 Bad Gateway error on Nginx? Check your application, upstream port, Nginx logs, and proxy configuration to fix it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/#primaryimage\",\"url\":\"https:\\\/\\\/getserverexplorer.app\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/fix-502-bad-gateway-nginx.webp\",\"contentUrl\":\"https:\\\/\\\/getserverexplorer.app\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/fix-502-bad-gateway-nginx.webp\",\"width\":1672,\"height\":941},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/2026\\\/11\\\/12\\\/how-to-fix-502-bad-gateway-on-nginx-5-checks\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/getserverexplorer.app\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fix 502 Bad Gateway on Nginx (5 Checks)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#website\",\"url\":\"https:\\\/\\\/getserverexplorer.app\\\/\",\"name\":\"Server Explorer\",\"description\":\"Server Explorer SSH client - SFTP Explorer, VPS Security, terminal, Ai Integrated, Cron Management, Docker Manager for Linux servers on Mac and Windows\",\"publisher\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#organization\"},\"alternateName\":\"Server Files Explorer\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/getserverexplorer.app\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#organization\",\"name\":\"Server Explorer\",\"alternateName\":\"Server Files Explorer\",\"url\":\"https:\\\/\\\/getserverexplorer.app\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/getserverexplorer.app\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/OIG.P8HQiZbb_YxAtGo_Pkmw-removebg-preview.png\",\"contentUrl\":\"https:\\\/\\\/getserverexplorer.app\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/OIG.P8HQiZbb_YxAtGo_Pkmw-removebg-preview.png\",\"width\":500,\"height\":500,\"caption\":\"Server Explorer\"},\"image\":{\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/darrell_kidjo\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/darrell-kidjo-ab49381a3\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/getserverexplorer.app\\\/#\\\/schema\\\/person\\\/20f67c2affa11693453fec19477c9ec8\",\"name\":\"darrellkidjo.dev\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/475cdf09b61eef7d56e50d2142844c4b668e33b2dd5202b6d97932ea1441fc7a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/475cdf09b61eef7d56e50d2142844c4b668e33b2dd5202b6d97932ea1441fc7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/475cdf09b61eef7d56e50d2142844c4b668e33b2dd5202b6d97932ea1441fc7a?s=96&d=mm&r=g\",\"caption\":\"darrellkidjo.dev\"},\"sameAs\":[\"https:\\\/\\\/getserverexplorer.app\"],\"url\":\"https:\\\/\\\/getserverexplorer.app\\\/index.php\\\/author\\\/darrellkidjo-dev\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Fix 502 Bad Gateway on Nginx (5 Checks) - Server Explorer","description":"Getting a 502 Bad Gateway error on Nginx? Check your application, upstream port, Nginx logs, and proxy configuration to fix it.","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:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/","og_locale":"en_US","og_type":"article","og_title":"How to Fix 502 Bad Gateway on Nginx (5 Checks) - Server Explorer","og_description":"Getting a 502 Bad Gateway error on Nginx? Check your application, upstream port, Nginx logs, and proxy configuration to fix it.","og_url":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/","og_site_name":"Server Explorer","article_published_time":"2026-11-12T09:15:00+00:00","og_image":[{"width":1672,"height":941,"url":"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/fix-502-bad-gateway-nginx.webp","type":"image\/png"}],"author":"darrellkidjo.dev","twitter_card":"summary_large_image","twitter_creator":"@darrell_kidjo","twitter_site":"@darrell_kidjo","twitter_misc":{"Written by":"darrellkidjo.dev","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/#article","isPartOf":{"@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/"},"author":{"name":"darrellkidjo.dev","@id":"https:\/\/getserverexplorer.app\/#\/schema\/person\/20f67c2affa11693453fec19477c9ec8"},"headline":"How to Fix 502 Bad Gateway on Nginx (5 Checks)","datePublished":"2026-11-12T09:15:00+00:00","mainEntityOfPage":{"@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/"},"wordCount":670,"commentCount":0,"publisher":{"@id":"https:\/\/getserverexplorer.app\/#organization"},"image":{"@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/#primaryimage"},"thumbnailUrl":"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/fix-502-bad-gateway-nginx.webp","articleSection":["Linux \/ Troubleshooting","VPS Management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/","url":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/","name":"How to Fix 502 Bad Gateway on Nginx (5 Checks) - Server Explorer","isPartOf":{"@id":"https:\/\/getserverexplorer.app\/#website"},"primaryImageOfPage":{"@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/#primaryimage"},"image":{"@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/#primaryimage"},"thumbnailUrl":"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/fix-502-bad-gateway-nginx.webp","datePublished":"2026-11-12T09:15:00+00:00","description":"Getting a 502 Bad Gateway error on Nginx? Check your application, upstream port, Nginx logs, and proxy configuration to fix it.","breadcrumb":{"@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/#primaryimage","url":"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/fix-502-bad-gateway-nginx.webp","contentUrl":"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2026\/11\/fix-502-bad-gateway-nginx.webp","width":1672,"height":941},{"@type":"BreadcrumbList","@id":"https:\/\/getserverexplorer.app\/index.php\/2026\/11\/12\/how-to-fix-502-bad-gateway-on-nginx-5-checks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/getserverexplorer.app\/"},{"@type":"ListItem","position":2,"name":"How to Fix 502 Bad Gateway on Nginx (5 Checks)"}]},{"@type":"WebSite","@id":"https:\/\/getserverexplorer.app\/#website","url":"https:\/\/getserverexplorer.app\/","name":"Server Explorer","description":"Server Explorer SSH client - SFTP Explorer, VPS Security, terminal, Ai Integrated, Cron Management, Docker Manager for Linux servers on Mac and Windows","publisher":{"@id":"https:\/\/getserverexplorer.app\/#organization"},"alternateName":"Server Files Explorer","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/getserverexplorer.app\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/getserverexplorer.app\/#organization","name":"Server Explorer","alternateName":"Server Files Explorer","url":"https:\/\/getserverexplorer.app\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/getserverexplorer.app\/#\/schema\/logo\/image\/","url":"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2024\/01\/OIG.P8HQiZbb_YxAtGo_Pkmw-removebg-preview.png","contentUrl":"https:\/\/getserverexplorer.app\/wp-content\/uploads\/2024\/01\/OIG.P8HQiZbb_YxAtGo_Pkmw-removebg-preview.png","width":500,"height":500,"caption":"Server Explorer"},"image":{"@id":"https:\/\/getserverexplorer.app\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/darrell_kidjo","https:\/\/www.linkedin.com\/in\/darrell-kidjo-ab49381a3\/"]},{"@type":"Person","@id":"https:\/\/getserverexplorer.app\/#\/schema\/person\/20f67c2affa11693453fec19477c9ec8","name":"darrellkidjo.dev","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/475cdf09b61eef7d56e50d2142844c4b668e33b2dd5202b6d97932ea1441fc7a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/475cdf09b61eef7d56e50d2142844c4b668e33b2dd5202b6d97932ea1441fc7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/475cdf09b61eef7d56e50d2142844c4b668e33b2dd5202b6d97932ea1441fc7a?s=96&d=mm&r=g","caption":"darrellkidjo.dev"},"sameAs":["https:\/\/getserverexplorer.app"],"url":"https:\/\/getserverexplorer.app\/index.php\/author\/darrellkidjo-dev\/"}]}},"_links":{"self":[{"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/posts\/694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/comments?post=694"}],"version-history":[{"count":1,"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/posts\/694\/revisions"}],"predecessor-version":[{"id":697,"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/posts\/694\/revisions\/697"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/media\/696"}],"wp:attachment":[{"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/media?parent=694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/categories?post=694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/getserverexplorer.app\/index.php\/wp-json\/wp\/v2\/tags?post=694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}