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 应用发布和数据卷。