ci: add test environment frontend deployment

This commit is contained in:
2026-07-30 21:18:39 +08:00
parent ae81edf69a
commit c1f6423c20
5 changed files with 105 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Docker 容器运行正常的检查地址,供 Jenkins 使用。
location = /healthz {
default_type text/plain;
return 200 "ok\n";
}
# 前端代码中的 API 前缀为 /api;保持原始路径转给 Gateway。
location /api/ {
proxy_pass ${API_UPSTREAM};
proxy_http_version 1.1;
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;
}
# Vue Router 的 history 路由刷新时仍返回 index.html。
location / {
try_files $uri $uri/ /index.html;
}
}