on-internet
← Community

FastAPI file upload returns 504 Gateway Timeout behind Nginx despite client_max_body_size

Stack Overflow ·

I am running a FastAPI application behind Nginx on a Linux server. When trying to upload large files (over 100MB up to 2GB), I get a 504 Gateway Timeout error. I have already updated `client_max_body_size 2048M;` in my Nginx configuration, but the connection still drops during large uploads. What exact Nginx proxy timeouts, buffering, or other directives do I need to add to my server block to allow large file uploads to Uvicorn without timing out?

Comments

Sign in or sign up to comment and upvote.

No comments yet.