// 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
Share

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

  1. FIX 1Set ROOT_URL correctly

    1. 01In app.ini [server] set ROOT_URL = https://git.example.com/
    2. 02Restart Gitea
    Did this fix it?
  2. FIX 2Forward the headers

    1. 01In nginx add proxy_set_header Host $host and X-Forwarded-Proto $scheme
    2. 02In Caddy or Traefik ensure the same forwarded headers are sent
    Did this fix it?
  3. FIX 3Subpath setups

    1. 01Include the subpath in ROOT_URL, for example https://example.com/git/
    2. 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 us

Watch Gitea Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Gitea errors

All 11 Gitea errors and fixes →