update at 2026-07-26 10:44:05

This commit is contained in:
douboer@gmail.com
2026-07-26 10:44:05 +08:00
parent e21fa7dcdd
commit 007d635516
7 changed files with 219 additions and 84 deletions

View File

@@ -34,16 +34,6 @@ server {
add_header Access-Control-Allow-Headers "Origin,Range,Accept,Content-Type,Authorization" always;
add_header Access-Control-Expose-Headers "Content-Length,Content-Range" always;
# MIME
types {
application/json json;
font/ttf ttf;
font/otf otf;
font/woff woff;
font/woff2 woff2;
application/vnd.ms-fontobject eot;
}
# SVG 渲染 API独立 Python 服务systemd 监听 127.0.0.1:9300
location ^~ /api/ {
# 预检请求:直接返回 204CORS 头由 server 级 add_header 提供)
@@ -93,11 +83,21 @@ server {
try_files $uri =404;
}
# 默认仅提供静态文件
location / {
# 小程序图标继续从项目根目录提供,避免与 Web 构建产物冲突。
location ^~ /assets/icons/ {
try_files $uri =404;
}
location = /assets/webicon.png {
try_files $uri =404;
}
# Web 应用由 Vite 构建产物提供;未知前端路由回退到首页。
location / {
root /home/gavin/font2svg/frontend/dist;
try_files $uri /index.html;
}
# 禁止访问隐藏文件
location ~ /\. {
deny all;