Skip to content

Commit 09ad1cd

Browse files
duskmoon314AbdulrhmnGhanem
authored andcommitted
doc: add brief intro on using traefik as reverse-proxy (go-gitea#19432)
1 parent e779fbb commit 09ad1cd

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,18 @@ The added http-request will automatically add a trailing slash if needed and int
348348

349349
Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration.
350350

351+
## Traefik
352+
353+
If you want traefik to serve your Gitea instance, you can add the following label section to your `docker-compose.yaml` (Assuming the provider is docker).
354+
355+
```yaml
356+
gitea:
357+
image: gitea/gitea
358+
...
359+
labels:
360+
- "traefik.enable=true"
361+
- "traefik.http.routers.gitea.rule=Host(`example.com`)"
362+
- "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000"
363+
```
364+
365+
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.

docs/content/doc/usage/reverse-proxies.zh-cn.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,19 @@ git.example.com {
106106
```
107107

108108
然后您**必须**在 Gitea 的配置文件中正确的添加类似 `[server] ROOT_URL = http://git.example.com/git/` 的配置项。
109+
110+
## 使用 Traefik 作为反向代理服务
111+
112+
如果您想使用 traefik 作为 Gitea 的反向代理服务,您可以在 `docker-compose.yaml` 中添加 label 部分(假设使用 docker 作为 traefik 的 provider):
113+
114+
```yaml
115+
gitea:
116+
image: gitea/gitea
117+
...
118+
labels:
119+
- "traefik.enable=true"
120+
- "traefik.http.routers.gitea.rule=Host(`example.com`)"
121+
- "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000"
122+
```
123+
124+
这份配置假设您使用 traefik 来处理 HTTPS 服务,并在其和 Gitea 之间使用 HTTP 进行通信。

0 commit comments

Comments
 (0)