Cause 1 of 6
The request genuinely takes longer than the proxy allows.
Make it asynchronous: accept the request, return 202 with a job id, do the work in a queue, and let the client poll or receive a webhook. Raising the timeout is a stopgap — most managed load balancers cap it anyway, and a request holding a worker for minutes hurts everything else on the box.
Cause 2 of 6
A slow query or a missing index.
Time the database work for that endpoint and run EXPLAIN ANALYZE on the slow query. An endpoint that was fine and got slow as data grew is nearly always a sequential scan that used to be small.
Cause 3 of 6
The application is blocked on a third party.
Set an explicit timeout on every outbound HTTP call your code makes — most clients default to waiting forever. Without one, a single slow vendor holds your workers until the proxy gives up on all of them.
Cause 4 of 6
Every worker is busy.
If the queue is full, even fast requests time out waiting for a slot. Check worker saturation and connection pool usage; adding workers helps only if the bottleneck is not the database behind them.
Cause 5 of 6
Timeouts across the chain are in the wrong order.
Client, CDN, load balancer and application server each have their own. Order them so the innermost is shortest and each layer outward is slightly longer — otherwise the proxy abandons work the application is still doing, and you pay for it twice.
Cause 6 of 6
A deadlock or an unbounded retry loop.
A request waiting on a lock another request holds never returns. Look for long-running transactions and retries with no cap; database lock views show what is blocking what.