uwsgi + nginx + flask: upstream prematurely closed

后端 未结 8 1924
暗喜
暗喜 2020-12-16 13:28

I created an endpoint on my flask which generates a spreadsheet from a database query (remote db) and then sends it as a download in the browser. Flask doesn\'t throw any er

相关标签:
8条回答
  • 2020-12-16 14:16

    I fixed this issue by passing socket-timeout = 65 (uwsgi.ini file) or --socket-timeout=65 (uwsgi command line) option in uwsgi. We have to check with different value depends on the web traffic. This value socket-timeout = 65 in uwsgi.ini file worked in my case.

    0 讨论(0)
  • 2020-12-16 14:18

    In my case, problem was nginx was sending a request with uwsgi protocol while uwsgi was listening on that port for http packets. So either I had to change the way nginx connects to uwsgi or change the uwsgi to listen using uwsgi protocol.

    0 讨论(0)
提交回复
热议问题