server { listen 80; server_name _; client_max_body_size 50M; root /usr/share/nginx/html; index index.html; # HTML 캐시 비활성화 location ~* \.html$ { expires -1; add_header Cache-Control "no-store, no-cache, must-revalidate"; } # 정적 파일 캐시 (JS, CSS, 이미지 등) location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf)$ { expires 1h; add_header Cache-Control "public, no-transform"; } # API 프록시 (System 1 API) location /api/ { proxy_pass http://system1-api:3005/api/; 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; } # 업로드 파일 프록시 (^~ 로 regex location보다 우선 매칭) location ^~ /uploads/ { proxy_pass http://system1-api:3005/uploads/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } # FastAPI Bridge 프록시 location /fastapi/ { proxy_pass http://system1-fastapi:8000/; 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; } # Static files (new Tailwind UI) location /static/ { expires 1h; add_header Cache-Control "public, no-transform"; } # SPA fallback location / { try_files $uri $uri/ /index.html; } }