upstream prematurely closed connection while reading response header from upstream

teal·2021년 10월 15일
0

upstream prematurely closed connection while reading response header from upstream

Django + nginx + gunicorn + docker를 이용하여 프로젝트 세팅 후

30초가 넘어가는 시간이 소요되는 api에 대해서

위와 같은 오류가 발생하여 구글링한 결과 여러 방법 해결방법이 나왔다.

처음에는 nginx에 proxy 설정을 진행했다.

proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
send_timeout 300;

2개의 nginx가 돌고있었는데 둘다 동일한 설정을 해줘도 해결 X

한참을 헤메다 gunicorn의 default timeout이 30초라는것을 알게되어
해당 timeout 시간을 늘려줘서 해결 완료

profile
고양이를 키우는 백엔드 개발자

1개의 댓글

comment-user-thumbnail
2021년 11월 13일

요샌 고양이가 안올라오네요 );

답글 달기