Next.js API Proxy Times Out After Long ML Inference (502) — Navigating Undici's Timeout Quagmire
DEV Community
Next.js API Proxy Times Out After Long ML Inference (502) — Navigating Undici's Timeout Quagmire
When proxying ML inference that takes minutes to hours through Next.js API routes, you hit a 502 due to Undici's default timeout. This post shares how to rewrite the proxy using Node's native http/https modules to bypass Undici's constraints and remove response wait limits.
0 comments
No comments yet.