server { listen 80; server_name review.seec.seecoder.cn; root /usr/share/nginx/html; index index.html; # 解决 Vue Router history 模式刷新 404 location / { try_files $uri $uri/ /index.html; } # 静态资源缓存 location ~* \.(js|css|png|svg|ico|woff2?)$ { expires 7d; add_header Cache-Control "public, immutable"; } # 反向代理后端 API,解决 HTTPS 页面请求 HTTP 接口的 Mixed Content 问题 location /api/ { proxy_pass http://environment-27-33.seec.svc.cluster.local:8080/api/; 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; } # 健康检查 location /health { return 200 "ok"; add_header Content-Type text/plain; } }