chore: 并入 iotlcm-docs 历史到 docs/(原提交 947e22e)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# VitePress 配置 base: '/docs/',构建产物里的资源引用是绝对路径 /docs/assets/xxx,
|
||||
# 而 dist 目录是平铺的(index.html、assets/ 直接在根)。
|
||||
# 因此必须在 /docs/ 路径下提供服务,用 alias 把前缀剥掉再落到产物目录,
|
||||
# 否则页面能返回 200 但 JS/CSS 全部 404 → 白屏。
|
||||
location /docs/ {
|
||||
alias /usr/share/nginx/html/;
|
||||
try_files $uri $uri.html $uri/ $uri/index.html =404;
|
||||
}
|
||||
|
||||
# 根路径跳到文档入口,避免访问 / 时白屏
|
||||
location = / {
|
||||
return 302 /docs/;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri.html $uri/ =404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user