Files
iotlcm/website/docker/nginx.prefix.conf
技小云 d78379486c feat: 新增开源版官网骨架 website/,并接入部署编排与网关路由
- website/:VitePress 官网工程(首页/功能/对比/快速开始/部署运维/教程/社区),与文档站同构
- 两种形态由 SITE_BASE 决定:/www/ 子路径(过渡)与 / 根路径(独立域名),内容同源
- deploy/:新增 with-website profile、网关 /www/ 路由、多域名 website vhost 段
- Makefile:新增 website 镜像条目与 make website 目标
- 教程页给出部署/使用两支视频的元数据与录制要求,官网留有教程入口
2026-11-04 10:41:05 +08:00

25 lines
910 B
Plaintext

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# 过渡形态:站点挂在统一网关的子路径下(没有独立域名时用)。
#
# VitePress 产物里的资源引用是绝对路径(<base>assets/xxx),
# 而 dist 目录是平铺的(index.html、assets/ 直接在根)。
# 因此必须在子路径下用 alias 把前缀剥掉再落到产物目录,
# 否则页面能返回 200 但 JS/CSS 全部 404 → 白屏。
# 网关侧对应 location ^~ <prefix> { proxy_pass http://gw_website; }(不剥前缀)。
location __SITE_BASE__ {
alias /usr/share/nginx/html/;
try_files $uri $uri.html $uri/ $uri/index.html =404;
}
# 访问不带尾斜杠的前缀时补斜杠,否则相对资源路径会解析错
location = __SITE_BASE_NO_SLASH__ {
return 301 __SITE_BASE__;
}
}