how to
how to solve "upstream prematurely closed connection" error
즉흥
2022. 2. 12. 00:56
728x90
반응형
flask, uwsgi, nginx 연동 도중 아래와 502 Bad Gateway 에러가 발생.
우선 /var/log/nginx/error.log를 확인했는데,
2022/02/12 00:49:54 [error] 1458540#1458540: *7 upstream prematurely closed connection while reading response header from upstream, client: 1.1.1.1, server: xxx.kr, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "xxx.kr:80"
이런 에러 로그가 있었다.
삽질 끝에 해결책을 발견했는데,
sudo apt install uwsgi-plugin-python
후에 uwsgi 실행하면서 --plugin python3 옵션을 넣어주니 해결!
uwsgi.ini에 plugins=python3를 추가해도 된다.
https://stackoverflow.com/questions/10748108/nginx-uwsgi-unavailable-modifier-requested-0
728x90
반응형