SystemEngineering/Web Application
-
Nginx Error: upstream prematurely closed connection while reading response header from upstreamSystemEngineering/Web Application 2021. 7. 30. 21:18
개요 "백엔드에서 애플리케이션은 동작하는데 2분 정도가 지나면 502 Bad Gateway Error가 발생하면서 값을 프론트에서 수신받지 못합니다. Nginx 설정 값을 수정해 주세요"라는 문의가 들어왔다. 이게 과연 Nginx 문제일까? Nginx config 파일 2분 정도에 연결이 끊긴다는 것은 timeout 설정 값을 확인해 볼 필요가 있다. upstream은 nodejs이고 proxy로 둔 nginx의 각 timeout은 300s이다. ... 생략 upstream nodejs { server 127.0.0.1:8081; keepalive 1024; } server { listen 8080; # Increase proxy timeout # ------------------------ proxy_..