Files
xiaoxia-saas/infra/docker/nginx-staging.conf
T
xiaoxia 2ce3a5efd3
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 2s
CI/CD Pipeline / Check push changed paths (push) Successful in 8s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 46s
CI/CD Pipeline / Build Staging API Image (push) Successful in 49s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 49s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 1m57s
AI Code Review / AI Code Review (pull_request) Successful in 2m6s
CI/CD Pipeline / Validate - Style (push) Successful in 2m16s
CI/CD Pipeline / Integration Tests (push) Successful in 2m23s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m19s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m9s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m41s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m30s
CI/CD Pipeline / Validate - Security (push) Successful in 5m13s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 2m41s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m35s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m28s
CI/CD Pipeline / Unit Tests (push) Successful in 8m25s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 6s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 4s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 31s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 29s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 35s
CI/CD Pipeline / CI Gate (pull_request) Successful in 2s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 240h44m37s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 240h49m32s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 240h56m53s
CI/CD Pipeline / Canary Release to Production (push) Failing after 241h4m38s
CI/CD Pipeline / Deploy Production (push) Failing after 241h9m49s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 241h10m2s
CI/CD Pipeline / Build Production Web Image (push) Failing after 241h10m2s
CI/CD Pipeline / Build Production API Image (push) Failing after 241h10m3s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 241h14m43s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 240h57m11s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 241h17m5s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 241h17m6s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 240h57m44s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 241h17m7s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 240h49m35s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 240h49m35s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 240h57m47s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 240h59m56s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 240h59m50s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 240h59m55s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Failing after 240h59m57s
CI/CD Pipeline / Validate - Security (pull_request) Failing after 240h59m58s
CI/CD Pipeline / Frontend Lint (push) Failing after 241h18m30s
CI/CD Pipeline / Validate - Style (pull_request) Failing after 240h59m59s
CI/CD Pipeline / PR Build Web Image (push) Failing after 241h18m36s
CI/CD Pipeline / PR Build API Image (push) Failing after 241h18m36s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 241h0m0s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 241h18m39s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 241h31m31s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 241h32m24s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 241h34m33s
CI/CD Pipeline / CI Gate (push) Failing after 241h44m38s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 241h31m31s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 241h24m11s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 241h34m31s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 241h34m6s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 241h34m31s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 241h53m12s
fix: SPA 路由回退的 HTML 补 no-cache 头(配合 #1732 白屏修复) (#1735)
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
2026-09-06 14:05:44 +08:00

58 lines
2.0 KiB
Plaintext
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/json application/xml+rss;
client_max_body_size 800m;
# SPA routing - all routes to index.html
# 注意:不能加 $uri/,否则 /assets 等与构建产物目录同名的路由会被当成目录访问,返回 403
# index.html must never be cached — it contains chunk references
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
expires 0;
}
location / {
try_files $uri /index.html;
# HTML 文档(含 try_files 回退的 SPA 路由,如 /login /app/dashboard)一律 no-cache,
# 每次校验 ETag/Last-Modified,保证发版后旧标签页重新加载拿到新 chunk 引用;
# 带 hash 的静态资源由下方 ~* \.(js|css...) location 优先匹配,不受影响、保持 immutable
add_header Cache-Control "no-cache" always;
}
# API proxy
# Staging environment: proxy to staging API container on isolated network
resolver 127.0.0.11 valid=10s;
resolver_timeout 5s;
location /api/ {
proxy_pass http://xiaoxia-api-staging:8000/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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_request_buffering off;
}
# Generated files proxy
location /generated-files/ {
alias /app/generated/;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}