反向代理
通用配置
- 在您的
app.ini
文件中添加配置[server] ROOT_URL = https://git.example.com/
- 将
https://git.example.com/foo
反向代理到http://gitea:3000/foo
- 确保反向代理不会解码 URI。
https://git.example.com/a%2Fb
的请求应该被传递给http://gitea:3000/a%2Fb
。 - 确保
Host
和X-Forwarded-Proto
头被正确的传递给 Gitea,使 Gitea 可以看到正在访问的真实 URL。
使用子路径
通常,不推荐将 Gitea 放到子路径。人们很少使用此配置,并且在极少数情况下可能会出现一些问题。
为了让 Gitea 在子路径工作(例如:https://common.example.com/gitea/