From e71fa6e3ed2063dd762b6ca6c3b876fe452f58dc Mon Sep 17 00:00:00 2001 From: v6ole Date: Fri, 26 Jun 2026 09:02:46 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=94=9F=E4=BA=A7=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E9=80=82=E9=85=8D=20=E2=80=94=20nginx.conf=20=E7=B2=BE?= =?UTF-8?q?=E7=AE=80=20+=20.gitignore=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - nginx.conf: 移除 /api/ 代理(改由 OpenResty 边缘路由),仅保留 SPA fallback - .gitignore: 排除所有 .env.* (保留 .env.example),防止 .env.production 误提交 Co-Authored-By: Claude --- .gitignore | 2 ++ frontend/nginx.conf | 15 +++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index cc7efa1..a177545 100644 --- a/.gitignore +++ b/.gitignore @@ -195,6 +195,8 @@ Thumbs.db # Env .env +.env.* +!.env.example # Deployment docs (contain credentials, not for git) *部署交接文档.md diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 3ea7914..8e3b95c 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -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"; } }