upstream llm_api { server llm-api:8100; keepalive 32; } server { listen 80; server_name _; # Timeouts for slow LLM responses proxy_connect_timeout 60s; proxy_send_timeout 120s; proxy_read_timeout 300s; # Health checks (no logging) location /health { access_log off; proxy_pass http://llm_api/health; proxy_http_version 1.1; proxy_set_header Host $host; } location /ready { access_log off; proxy_pass http://llm_api/ready; proxy_http_version 1.1; proxy_set_header Host $host; } # API endpoints location / { proxy_pass http://llm_api; proxy_http_version 1.1; # Forward client info proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # SSE streaming support proxy_set_header Connection ''; proxy_buffering off; proxy_cache off; chunked_transfer_encoding off; # Large request bodies for long conversations client_max_body_size 10M; } }