I created an endpoint on my flask that generates a spreadsheet from a database query (remote db) and then sends it as a download in a browser. The flask does not cause any errors. Uwsgi is not complaining.
But when I check nginx error.log, I see a lot
2014/12/10 05:06:24 [error] 14084 # 0: * 239436 upstream prematurely closed connection while reading the response header up, client: 34.34.34.34, server: me.com, request: "GET / download / export.csv HTTP / 1.1 ", upstream:" uwsgi: //0.0.0.0: 5002 ", host:" me.com ", referrer:" https://me.com/download/export.csv "
I am using uwsgi for example
uwsgi --socket 0.0.0.0:5002 --buffer-size=32768 --module server --callab app
my nginx config:
server {
listen 80;
merge_slashes off;
server_name me.com www.me.cpm;
location / { try_files $uri @app; }
location @app {
include uwsgi_params;
uwsgi_pass 0.0.0.0:5002;
uwsgi_buffer_size 32k;
uwsgi_buffers 8 32k;
uwsgi_busy_buffers_size 32k;
}
}
server {
listen 443;
merge_slashes off;
server_name me.com www.me.com;
location / { try_files $uri @app; }
location @app {
include uwsgi_params;
uwsgi_pass 0.0.0.0:5002;
uwsgi_buffer_size 32k;
uwsgi_buffers 8 32k;
uwsgi_busy_buffers_size 32k;
}
}
Is this a nginx or uwsgi problem, or both?