Add never option to PUBLIC_URL_DETECTION configuration (#353)

https://github.com/go-gitea/gitea/pull/36785
Reviewed-on: https://gitea.com/gitea/docs/pulls/353
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
Zettat123
2026-03-01 19:00:35 +00:00
committed by Lunny Xiao
parent d6bd3c6fb9
commit dc136aa31b
2 changed files with 2 additions and 0 deletions

View File

@@ -316,6 +316,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
especially when the Gitea instance needs to be accessed in a container network.
- "legacy": generate the public URL by "Host" header if "X-Forwarded-Proto" header exists, otherwise use "ROOT_URL".
- "auto": always use "Host" header, and also use "X-Forwarded-Proto" header if it exists. If no "Host" header, use "ROOT_URL".
- "never": always use "ROOT_URL", never detect from request headers.
- `STATIC_URL_PREFIX`: **_empty_**:
Overwrite this option to request static resources from a different URL.
This includes CSS files, images, JS files and web fonts.

View File

@@ -292,6 +292,7 @@ aliases:
虽然它的默认值是 "legacy"(避免影响老的用户),大多数实例都应当使用 "auto" 行为,尤其是 Gitea 实例需要在容器网络中被访问的场景。
- "legacy": 当 "X-Forwarded-Proto" 请求头存在的时候,使用 "Host" 请求头生成公共 URL否则使用 "ROOT_URL"。
- "auto": 总是使用 "Host" 请求头生成公共 URL如果 "X-Forwarded-Proto" 请求头存在也会使用它。如果没有 "Host" 请求头则使用 "ROOT_URL"。
- "never": 总是使用 "ROOT_URL" 生成公共 URL不从请求头进行检测。
- `STATIC_URL_PREFIX`: **_empty_**:
覆盖此选项以从不同的 URL 请求静态资源。
这包括 CSS 文件、图片、JS 文件和 Web 字体。