server { listen 3000; server_name localhost; root /usr/share/nginx/html; index index.html index.htm; # 🔧 요청 크기 제한 증가 (413 오류 해결) client_max_body_size 100M; # SPA를 위한 설정 (React Router 등) location / { try_files $uri $uri/ /index.html; } # API 프록시 설정 location /api/ { proxy_pass http://backend:8000/; 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_request_buffering off; client_max_body_size 100M; } # 정적 파일 캐싱 location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { expires 1y; add_header Cache-Control "public, immutable"; } }