I am running a django app with nginx in docker. I can download files via an API using the library requests
. When I want to download a file with 55 MB somehow the connection breaks down and the download doesn't finish.
I tried tweaking nginx configs like this but still the download does not succeed:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
multi_accept off;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
send_timeout 7200;
keepalive_timeout 7200;
fastcgi_read_timeout 7200;
proxy_read_timeout 7200;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
I also tried to set the workers higher but it is not recommended in the docs. I set the values of
send_timeout 7200;
keepalive_timeout 7200;
fastcgi_read_timeout 7200;
proxy_read_timeout 7200;
very high so the server doesn't close the connection. But the download still breaks after like 27 MB.
Is there any config that would cause this?
Help is very much appreciated. Thanks so much in advance.
EDIT: I can download the file with a fast internet connection in the browser. But when the connection is slow it breaks. But I need to be able to download files with a slower connection too..
EDIT2: Trailing the logs in real time I got a [CRITICAL] WORKER TIMEOUT (pid:18) . Is that nginx related?
0 Answers