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
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.
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.