问题描述
当我尝试从我的服务器下载文件时遇到问题。当我通过快速互联网连接下载文件时,一切都很好..但互联网速度较慢的其他用户无法完成下载。 下载文件大约在 7 分钟后中止并出现错误:
[error] 194621#194621: *135815 upstream prematurely closed connection while sending to client...
我的服务器配置(基于 docker)
前端Nginx:
location / {
proxy_pass http://172.26.141.15;
proxy_http_version 1.1;
proxy_buffering off;
proxy_redirect off;
proxy_request_buffering off;
proxy_connect_timeout 7200s;
proxy_send_timeout 7200s;
proxy_read_timeout 7200s;
proxy_buffer_size 64k;
proxy_buffers 16 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_set_header Host $host;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header If-Range "";
后端Nginx
upstream ui_loadbalancer {
ip_hash;
server filehost-PHP:9000; # location of my first PHP-fpm server
}
server {
listen 80;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 80M;
keepalive_timeout 15;
sendfile on;
sendfile_max_chunk 512k;
send_timeout 10;
location / {
try_files $uri /index.PHP$is_args$args;
}
location ~ ^/index\.PHP(/|$) {
fastcgi_split_path_info ^(.+\.PHP)(/.*)$;
fastcgi_pass ui_loadbalancer;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
另外我通过
扩展了PHP.ini"max_execution_time = 7200"
和 PHP-fpm
"request_terminate_timeout = 7200"
您知道为什么下载会在大约 7 分钟后中止吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)