chore: 生产部署适配 — nginx.conf 精简 + .gitignore 更新

- nginx.conf: 移除 /api/ 代理(改由 OpenResty 边缘路由),仅保留 SPA fallback
- .gitignore: 排除所有 .env.* (保留 .env.example),防止 .env.production 误提交

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-06-26 09:02:46 +08:00
parent c2a62c29cd
commit e71fa6e3ed
2 changed files with 5 additions and 12 deletions
+2
View File
@@ -195,6 +195,8 @@ Thumbs.db
# Env
.env
.env.*
!.env.example
# Deployment docs (contain credentials, not for git)
*部署交接文档.md
+3 -12
View File
@@ -5,22 +5,13 @@ server {
root /usr/share/nginx/html;
index index.html;
# Vue app
# SPA fallback
location / {
try_files $uri $uri/ /index.html;
}
# API proxy
location /api/ {
proxy_pass http://backend:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Health check
location /health {
proxy_pass http://backend:8000;
proxy_set_header Host $host;
return 200 "ok";
}
}