Skip to content

Commit 0ce79bb

Browse files
Improve reverse proxies documentation (#23068)
Add "Traefik with a sub-path" documentation closes #23047 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
1 parent 6c35454 commit 0ce79bb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/content/doc/usage/reverse-proxies.en-us.md

+20
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,23 @@ gitea:
365365
```
366366
367367
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
368+
369+
## Traefik with a sub-path
370+
371+
In case you already have a site, and you want Gitea to share the domain name, you can setup Traefik to serve Gitea under a sub-path by adding the following to your `docker-compose.yaml` (Assuming the provider is docker) :
372+
373+
```yaml
374+
gitea:
375+
image: gitea/gitea
376+
...
377+
labels:
378+
- "traefik.enable=true"
379+
- "traefik.http.routers.gitea.rule=Host(`example.com`) && PathPrefix(`/gitea`)"
380+
- "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000"
381+
- "traefik.http.middlewares.gitea-stripprefix.stripprefix.prefixes=/gitea"
382+
- "traefik.http.routers.gitea.middlewares=gitea-stripprefix"
383+
```
384+
385+
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
386+
387+
Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration.

0 commit comments

Comments
 (0)