server {
    listen 3000;
    root /usr/share/nginx/html;
    index index.html;

    # SPA — 모든 경로를 index.html로
    location / {
        try_files $uri $uri/ /index.html;
    }

    # API 프록시 → 백엔드 컨테이너
    location /api/ {
        proxy_pass http://dashboard-api:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    # 캐시 설정
    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
        expires 7d;
        add_header Cache-Control "public, immutable";
    }
}
