diff options
author | Campbell He <duskmoon314@users.noreply.github.com> | 2022-04-20 22:08:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-20 16:08:23 +0200 |
commit | f2229e0566478f8a2d8b968777f8ff356f1d4900 (patch) | |
tree | 8b6957355d632c6b6913c92e9f55b4ed19efe773 /docs | |
parent | ae6a52440ac47b8d0eed5875de9d801bc68c1a4a (diff) | |
download | gitea-f2229e0566478f8a2d8b968777f8ff356f1d4900.tar.gz gitea-f2229e0566478f8a2d8b968777f8ff356f1d4900.zip |
doc: add brief intro on using traefik as reverse-proxy (#19432)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/doc/usage/reverse-proxies.en-us.md | 15 | ||||
-rw-r--r-- | docs/content/doc/usage/reverse-proxies.zh-cn.md | 16 |
2 files changed, 31 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 90b2765daa..008704cdcf 100644 --- a/docs/content/doc/usage/reverse-proxies.en-us.md +++ b/docs/content/doc/usage/reverse-proxies.en-us.md @@ -348,3 +348,18 @@ The added http-request will automatically add a trailing slash if needed and int Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration. +## Traefik + +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). + +```yaml +gitea: + image: gitea/gitea + ... + labels: + - "traefik.enable=true" + - "traefik.http.routers.gitea.rule=Host(`example.com`)" + - "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000" +``` + +This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
\ No newline at end of file diff --git a/docs/content/doc/usage/reverse-proxies.zh-cn.md b/docs/content/doc/usage/reverse-proxies.zh-cn.md index 741f739dbd..88db0c3790 100644 --- a/docs/content/doc/usage/reverse-proxies.zh-cn.md +++ b/docs/content/doc/usage/reverse-proxies.zh-cn.md @@ -106,3 +106,19 @@ git.example.com { ``` 然后您**必须**在 Gitea 的配置文件中正确的添加类似 `[server] ROOT_URL = http://git.example.com/git/` 的配置项。 + +## 使用 Traefik 作为反向代理服务 + +如果您想使用 traefik 作为 Gitea 的反向代理服务,您可以在 `docker-compose.yaml` 中添加 label 部分(假设使用 docker 作为 traefik 的 provider): + +```yaml +gitea: + image: gitea/gitea + ... + labels: + - "traefik.enable=true" + - "traefik.http.routers.gitea.rule=Host(`example.com`)" + - "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000" +``` + +这份配置假设您使用 traefik 来处理 HTTPS 服务,并在其和 Gitea 之间使用 HTTP 进行通信。
\ No newline at end of file |