# 504 Errors with Reverse Proxy in Docker

**URL:** https://forum.gitea.com/t/504-errors-with-reverse-proxy-in-docker/12397
**Category:** Install/Maintain/Configure
**Created:** [August 31, 2026, 6:33pm UTC](https://forum.gitea.com/t/504-errors-with-reverse-proxy-in-docker/12397 "2026-08-31T18:33:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sageRJ](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sageRJ](https://forum.gitea.com/u/sageRJ)
#### Post date: [August 31, 2026, 6:33pm UTC](https://forum.gitea.com/t/504-errors-with-reverse-proxy-in-docker/12397/1 "2026-08-31T18:33:57Z")

</div>

Are there any known issues running Gitea in a docker container behind a reverse proxy? For years we have experienced sporadic 504 errors that occur more often than not. We can’t seem to find any rhyme or reason to it. Sometimes it just works and most times it doesn’t.

- Always a 504
- Occurs whether cloning, pulling or pushing
- Across multiple clients: VS (MinGit), VSCode, TortoiseGit
- Across multiple reverse proxies: recently migrated from Zoraxy to Nginx. Same behavior.
- Not a high-volume instance
- All traffic is http (not s) on internal network - no pushing/pulling over internet.
- Version 1.25.3

---

<div class="post-metadata">

### Author: ![nite\_route](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/nite_route/32/7522_2.png) [@nite\_route](https://forum.gitea.com/u/nite_route)
#### Post date: [August 31, 2026, 8:18pm UTC](https://forum.gitea.com/t/504-errors-with-reverse-proxy-in-docker/12397/2 "2026-08-31T20:18:19Z")

</div>

504 is the proxy giving up waiting on gitea. since it followed you from zoraxy to nginx its the timeouts + git smart-http buffering, not the proxy brand.

nginx:

location / {  
proxy\_pass [http://gitea:3000](http://gitea:3000);  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header X-Forwarded-Proto $scheme;  
client\_max\_body\_size 0;  
proxy\_read\_timeout 3600;  
proxy\_send\_timeout 3600;  
proxy\_buffering off;  
proxy\_request\_buffering off;  
}

ROOT\_URL in gitea has to match what the clients actually use, even on plain http.

git over ssh skips this whole mess if you can open 2222. docker logs on the gitea container while you push, if gitea itself is stuck the timeout is just the symptom.
