What is the default Nginx proxy_read_timeout?
60 seconds. Note that `proxy_read_timeout` measures the interval between two successive read operations, not the entire response duration.
HTTP 504 Gateway Timeout means your reverse proxy or load balancer connected to the upstream server, but the upstream did not finish responding before `proxy_read_timeout` (default 60s in Nginx/AWS ALB) expired.
location /api/reports/ {
proxy_connect_timeout 15s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
proxy_pass http://127.0.0.1:3000;
}
# Better long-term fix: return 202 Accepted + job_id and poll /jobs/:id
curl -i -sS -w '\nTTFB: %{time_starttransfer}s Total: %{time_total}s\n' https://api.example.com/api/reports/export
60 seconds. Note that `proxy_read_timeout` measures the interval between two successive read operations, not the entire response duration.
Only as a short-term workaround. Long synchronous requests tie up worker threads and still fail behind Cloudflare's 100s limit—move heavy work to an async queue returning 202 Accepted.
Measure `time_starttransfer` with curl: 60s usually points to Nginx/ALB, 29s points to AWS API Gateway, and 100s points to Cloudflare 524.