// troubleshooting guide · gitea
Gitea Reverse Proxy Wrong URLs or Redirect Loop (ROOT_URL)
- Status
- Workaround available
- platforms:
- nginx, Caddy, Traefik, Helm ingress
- updated:
- November 16, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · gitea/reverse-proxy-wrong-urls3 FIXES
// quick answer
Set ROOT_URL to the public URL and have the proxy pass the Host header and X-Forwarded-Proto. Subpath installs also need the subpath in ROOT_URL.
Most likely fix: Set ROOT_URL correctly
How to fix it
// try these in order, the most common fix is first
FIX 1Set ROOT_URL correctly
- 01In app.ini [server] set ROOT_URL = https://git.example.com/
- 02Restart Gitea
Did this fix it?FIX 2Forward the headers
- 01In nginx add proxy_set_header Host $host and X-Forwarded-Proto $scheme
- 02In Caddy or Traefik ensure the same forwarded headers are sent
Did this fix it?FIX 3Subpath setups
- 01Include the subpath in ROOT_URL, for example https://example.com/git/
- 02Match the proxy's path handling to it
Did this fix it?
SANDBOX · gitea RUNS IN YOUR BROWSER
Try it: push, review, run CI and merge in a code host and cloud workspace
A hands-on Gitea-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.
Symptoms
Links use http instead of https, login redirects loop, or a warning says the detected site URL does not match the configured one.
Why it happens
- C-01ROOT_URL does not match the public URL
- C-02Proxy does not forward Host or X-Forwarded-Proto
- C-03Gitea served under a subpath without it in ROOT_URL
- C-04TLS terminated at the proxy but Gitea thinks http
// this guide also covers
- gitea root_url mismatch
- gitea redirect loop reverse proxy
- gitea nginx proxy https
Still not working?
If Gitea keeps failing, you're not alone. See every Gitea problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other Gitea errors
- Gitea Actions Jobs Stuck in Waiting (No Matching Runner)
- Gitea SSH Permission Denied (publickey) or Connection Refused
- Gitea 500 Internal Server Error
- Gitea Push 413 Request Entity Too Large (LFS Upload Fails)
- Gitea Webhook Not Working (ALLOWED_HOST_LIST Error)
- Gitea Email Notifications Not Sending (SMTP Error)
- Why Is Gitea Using So Much Memory or CPU?
- Gitea Upgrade Failed or Database Is Locked