From 415f7f8909ff39c35217e7900409f61c5552e16b Mon Sep 17 00:00:00 2001 From: Redamancy <848238014@qq.com> Date: Sat, 12 Sep 2026 00:45:20 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(deploy):=20=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=E7=AE=80=E5=8E=86=E5=BF=AB=E9=80=9F=E9=A2=84=E8=A7=88=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 背景:提供无需下载的浏览器简历预览地址。 变更:增加精确 /cv 的 Nginx location 模板并记录只读 PDF 部署边界。 验证:待 CI 与服务器发布后验证。 Refs #146 --- deployment/nginx/cv.location.conf | 7 +++++++ docs/deployment/babelflux-icu.md | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 deployment/nginx/cv.location.conf diff --git a/deployment/nginx/cv.location.conf b/deployment/nginx/cv.location.conf new file mode 100644 index 0000000..5fa859e --- /dev/null +++ b/deployment/nginx/cv.location.conf @@ -0,0 +1,7 @@ +# Include inside each HTTPS server block after placing the authorized PDF at this path. +location = /cv { + alias /opt/babelflux/public/cv.pdf; + default_type application/pdf; + add_header Content-Disposition "inline" always; + add_header X-Content-Type-Options nosniff always; +} diff --git a/docs/deployment/babelflux-icu.md b/docs/deployment/babelflux-icu.md index e33e87e..132d914 100644 --- a/docs/deployment/babelflux-icu.md +++ b/docs/deployment/babelflux-icu.md @@ -28,6 +28,7 @@ - 后端:`babelflux.service`,`127.0.0.1:8000` - 前端:Nginx `:80`,`babelflux.icu` / `www.babelflux.icu` - 配置:`/etc/babelflux/babelflux.env`、`/etc/systemd/system/babelflux.service`、`/etc/nginx/sites-available/babelflux` +- 简历预览:授权 PDF 位于服务器 `/opt/babelflux/public/cv.pdf`,通过 Nginx 精确 location `/cv` 内联提供;文件不进入 Git。 ### 实测结果 @@ -57,3 +58,6 @@ ln -sfn /opt/babelflux/releases/ /opt/babelflux/current systemctl start babelflux nginx -t && systemctl reload nginx ``` + +简历入口回退时只需移除两个 HTTPS server 中的 `deployment/nginx/cv.location.conf` +对应 location 并 reload Nginx,不影响 BabelFlux 应用发布和数据卷。