Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx 502 when working with gunicorn + uvicorn worker + fastAPI #3323

Open
zffocussss opened this issue Nov 5, 2024 · 1 comment
Open

nginx 502 when working with gunicorn + uvicorn worker + fastAPI #3323

zffocussss opened this issue Nov 5, 2024 · 1 comment

Comments

@zffocussss
Copy link
Contributor

Hi team
I am facing an issue where when a user requests a fast API endpoint through Nginx, the Nginx server log emits 502 errors,which highlight "upstream prematurely closed connection while reading response header from upstream " in the Nginx log.
but I do not find what happened at that time.,as I can not find the corresponding logs in backend application log.Can someone help me how to investigate it?

@tnusser
Copy link

tnusser commented Feb 5, 2025

We face a similar issue that gunicorn rarely (~every 50.000th request) returns a 502-Error without ever showing up in the application logs. Since we stoped using the max-request parameter #3038 it happens less frequently but it is still around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants