server { listen 80; server_name localhost; # Allow larger request bodies (up to 10MB) client_max_body_size 10M; # Serve static files location / { root /usr/share/nginx/html; try_files $uri /index.html; } # Proxy API requests to Node.js backend location /api/ { proxy_pass http://localhost:3001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; 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; # Allow larger bodies for API requests client_max_body_size 10M; proxy_read_timeout 300s; proxy_connect_timeout 75s; } }