server { listen 80; server_name _; # Frontend SPA location / { proxy_pass http://frontend:5173; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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; } # API location /api/ { proxy_pass http://api:8000/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; proxy_read_timeout 120s; client_max_body_size 10M; } # MCP Server (SSE support) location /mcp/ { proxy_pass http://mcp:3200/; 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; # SSE support proxy_set_header Connection ""; proxy_buffering off; proxy_cache off; proxy_read_timeout 600s; } # Rendered media (thumbnails, preview videos) location /renders/ { alias /renders/; expires 30d; add_header Cache-Control "public, immutable"; } # Health check location /health { access_log off; return 200 "ok"; } }