master #14

Merged
kdletters merged 226 commits from master into release 2026-05-13 13:23:09 +08:00
2 changed files with 3 additions and 7 deletions
Showing only changes of commit 188c6704db - Show all commits

View File

@@ -10,9 +10,10 @@
## Brotli
- Brotli 只在目标服务器 Nginx 编译/加载了 brotli 模块时开启。
- Provision 脚本通过 `nginx -V` `nginx -t` 做探测;可用时把模板中的 `# __GENARRATIVE_BROTLI_DIRECTIVES__` 替换为 brotli 指令,不可用时保留注释说明。
- Brotli 只在目标服务器 Nginx 接受 brotli 指令时开启。
- Provision 脚本通过临时配置执行 `nginx -t`能力探测;可用时把模板中的 `# __GENARRATIVE_BROTLI_DIRECTIVES__` 替换为 brotli 指令,不可用时保留注释说明。
- 不要直接在静态模板里无条件写 `brotli on;`,否则没有 brotli 模块的服务器会 `nginx -t` 失败并回滚。
- 不要用 `nginx -V | grep brotli` 判断 brotli 是否可用Ubuntu apt 安装的 brotli 是动态模块,可能只出现在 `nginx -T``load_module` 配置里。
## 验证

View File

@@ -301,11 +301,6 @@ render_nginx_brotli_directives() {
return
fi
if ! nginx -V 2>&1 | grep -qi brotli; then
echo " # Brotli 未启用:当前 nginx 未编译或加载 brotli 模块。"
return
fi
local brotli_snippet
brotli_snippet="$(mktemp)"
cat >"${brotli_snippet}" <<'EOF'