What are proxy buffers in Nginx?
Proxy buffering (proxy_buffering on) makes Nginx buffer the response from Node.js before sending to the client. This frees Node.js to handle other requests. Set proxy_buffer_size 4k and proxy_buffers 8 4k for typical API responses.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Nginx Performance Tuning for Node.js Worker Processes, Caching, and Compression
Set worker_processes auto (one per CPU core) and worker_connections 2048 in nginx.conf. Total max clients = worker_processes × worker_connections. On a t2.micro with 1 vCPU, you get 1 worker × 2048 = 2048 concurrent connections.
Set gzip on, gzip_comp_level 6, gzip_min_length 1000, gzip_types for text-based MIME types (text/plain, text/css, application/json, application/javascript). Add gzip_vary on for the Vary header. This reduces bandwidth by 60-80%.
Add a location block matching static file extensions (js, css, png, jpg, etc.) with expires 1y, add_header Cache-Control 'public, immutable', and access_log off. Hashed file names from build tools ensure new versions get new URLs.
Still have questions?
Browse all our FAQs or reach out to our support team
