From 257105ec107c14ba694afd58739d0c2a676c141a Mon Sep 17 00:00:00 2001 From: keith Date: Mon, 15 Jun 2026 09:56:24 +0000 Subject: [PATCH] Add troubleshooting/bad-gateway-gitea.md --- troubleshooting/bad-gateway-gitea.md | 113 +++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 troubleshooting/bad-gateway-gitea.md diff --git a/troubleshooting/bad-gateway-gitea.md b/troubleshooting/bad-gateway-gitea.md new file mode 100644 index 0000000..ee98257 --- /dev/null +++ b/troubleshooting/bad-gateway-gitea.md @@ -0,0 +1,113 @@ +# Gitea Bad Gateway Error + +## Problem + +After creating a proxy host for Gitea in Nginx Proxy Manager, visiting: + +```text +https://git.casko.dev +``` + +resulted in: + +```text +502 Bad Gateway +``` + +## Environment + +* Hetzner Cloud Server +* Ubuntu 24.04 +* Docker +* Gitea +* Nginx Proxy Manager + +## Cause + +Nginx Proxy Manager could not communicate with the Gitea container. + +The proxy host was configured to forward traffic to: + +```text +95.216.204.54:3000 +``` + +Instead of the Docker container name. + +Containers on the same Docker network should communicate using container names, not the server's public IP address. + +## Investigation + +Verified Gitea was running: + +```bash +docker ps +``` + +Verified Gitea was accessible directly: + +```text +http://95.216.204.54:3000 +``` + +Nginx Proxy Manager still returned a 502 error. + +## Fix + +Updated the proxy host settings. + +### Before + +Forward Hostname: + +```text +95.216.204.54 +``` + +Forward Port: + +```text +3000 +``` + +### After + +Forward Hostname: + +```text +gitea +``` + +Forward Port: + +```text +3000 +``` + +Saved the proxy host configuration. + +## Result + +The proxy host immediately began working. + +The following URL became accessible: + +```text +https://git.casko.dev +``` + +SSL certificates continued functioning correctly. + +## Lessons Learned + +When Docker containers share a network: + +* Use container names +* Avoid public IP addresses +* Verify container names with: + +```bash +docker ps +``` + +Docker's internal DNS automatically resolves container names.