aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/doc/usage
diff options
context:
space:
mode:
authorJoakim Pettersen <jo.pettersen@protonmail.com>2023-02-23 08:34:09 +0100
committerGitHub <noreply@github.com>2023-02-23 15:34:09 +0800
commit0ce79bb9f6d9bb070ff53d08a939112005ac3564 (patch)
tree82b2f49b8b7e4b7e125b1bb83d35cabe65570ce4 /docs/content/doc/usage
parent6c354546547cd3a9595a7db119a6480d9cd506a7 (diff)
downloadgitea-0ce79bb9f6d9bb070ff53d08a939112005ac3564.tar.gz
gitea-0ce79bb9f6d9bb070ff53d08a939112005ac3564.zip
Improve reverse proxies documentation (#23068)
Add "Traefik with a sub-path" documentation closes #23047 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'docs/content/doc/usage')
-rw-r--r--docs/content/doc/usage/reverse-proxies.en-us.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/content/doc/usage/reverse-proxies.en-us.md b/docs/content/doc/usage/reverse-proxies.en-us.md
index 5797d8e5eb..b8cebee574 100644
--- a/docs/content/doc/usage/reverse-proxies.en-us.md
+++ b/docs/content/doc/usage/reverse-proxies.en-us.md
@@ -365,3 +365,23 @@ gitea:
```
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
+
+## Traefik with a sub-path
+
+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) :
+
+```yaml
+gitea:
+ image: gitea/gitea
+ ...
+ labels:
+ - "traefik.enable=true"
+ - "traefik.http.routers.gitea.rule=Host(`example.com`) && PathPrefix(`/gitea`)"
+ - "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000"
+ - "traefik.http.middlewares.gitea-stripprefix.stripprefix.prefixes=/gitea"
+ - "traefik.http.routers.gitea.middlewares=gitea-stripprefix"
+```
+
+This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
+
+Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration.