> ## Content Index
> Fetch the complete content index at: https://debugly.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# 502 Bad Gateway From Nginx: Which Side Is Actually Broken
- URL: https://debugly.dev/nginx-502-bad-gateway-debugging/
- Published: 2025-11-25T14:00:00.000Z
- Updated: 2026-10-17T05:49:31.000Z
- Description: The proxy is telling you your application failed. Here is how to read the error log line and identify which of six things went wrong.
- Author: Rohit Bhadani
- Tags: Networking, DevOps, Error Autopsy, Debugging

| Message                                | Cause                                  |
| -------------------------------------- | -------------------------------------- |
| Connection refused (111)               | Nothing listening on that port         |
| no live upstreams                      | All backends marked failed             |
| upstream prematurely closed connection | Your app crashed mid-response          |
| upstream timed out (110)               | App too slow, this is a 504            |
| upstream sent too big header           | Response headers exceed the buffer     |
| Permission denied (13)                 | SELinux or a socket permission problem |

---

Published on [debugly.dev](https://debugly.dev/) by [Rohit Bhadani](https://debugly.dev/about/) | Founder of [Krova Cloud](https://krova.cloud/?ref=debugly.dev)