ERPNextCalc aligns Nginx upstream proxy_read_timeout strictly with your Gunicorn http_timeout (120–300 seconds) so long accounting reports never fail prematurely at the reverse proxy.
Serving static /assets/ files directly from Nginx bypasses Python Gunicorn completely, cutting web-tier CPU overhead by 35% on busy ERPNext desks.
Frappe bench compiles Desk JavaScript and CSS bundles into sites/assets/. Configuring Nginx with try_files and 30-day immutable cache headers keeps Gunicorn reserved strictly for dynamic /api/method and Desk RPC calls.
We recommend setting client_max_body_size 50m so manufacturing CAD drawings and scanned vendor invoices upload without 413 Request Entity Too Large errors.
ERPNextCalc Upstream Keepalive & Buffer Settings
Enabling proxy_buffer_size 128k and proxy_buffers 4 256k prevents Nginx from spilling large JSON report payloads to temporary disk files under /var/lib/nginx.
We advise keeping Nginx worker_processes auto with 1,024 worker_connections, consuming under 128 MB of host RAM.
ERPNextCalc Nginx Upstream & Timeout Snippet
upstream frappe-bench-frappe { server 127.0.0.1:8000 fail_timeout=0; }
upstream frappe-bench-socketio-server { server 127.0.0.1:9000 fail_timeout=0; }
# Match http_timeout in common_site_config.json
proxy_read_timeout 120;
client_max_body_size 50m;
Directive
ERPNextCalc Default
Heavy Report Profile
Purpose
proxy_read_timeout
120s
300s
Matches Gunicorn -t timeout
client_max_body_size
50m
100m
Allows CAD/PDF attachments
proxy_buffers
4 256k
8 256k
Avoids disk temp buffering
Synchronizing Nginx timeouts with ERPNextCalc Gunicorn settings removes mysterious 504 errors during month-end financial close.
Use the ERPNextCalc Config Studio to copy matching http_timeout values into your bench configuration.