不幸的是,我无法完全下载任何大于1GB(~1054 MB)的文件。下载文件由php生成,1GB以下的所有内容都可以使用。我已经做了一些研究并且没有运气就编辑了配置文件。
NGINX服务器配置:
server {
listen 80;
listen [::]:80;
server_name example.de;
return 301 https://$server_name$request_uri; }
server { listen 443 http2 ssl;
listen [::]:433 http2 ssl;
server_name example.de;
server_tokens off;
root /var/www/lychee/;
index index.php index.html index.htm;
access_log /var/log/nginx/lychee.access.log combined_ssl;
error_log /var/log/nginx/lychee.error.log info;
location ~ \.html$ { perl Minify::html_handler; }
location ~ \.css$ { perl Minify::css_handler; }
location ~ \.js$ { perl Minify::js_handler; }
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 100m;
large_client_header_buffers 2 1k;
location / {
try_files $uri $uri/ =404;
client_body_buffer_size 10K;
client_max_body_size 100m;
proxy_request_buffering off;
proxy_max_temp_file_size 2048m;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param PHP_VALUE open_basedir="/var/www/:/tmp/";
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
access_log off;
fastcgi_read_timeout 600;
}
location ~* \.(png|jpg|jpeg|gif|ico|woff|otf|ttf|css|js|svg|txt|pdf|docx?|xlsx?)$ {
access_log off;
log_not_found off;
}
}
FPM php.ini :(我明确编辑的选项)
[PHP]
output_buffering = 4096
open_basedir = "/var/www/:/tmp/:/usr/share/php/"
max_execution_time = 600
max_input_time = 600
memory_limit = 1024M
post_max_size = 100M
NGINX error.log :
2017/12/15 13:22:15 [warn] 22198#22198: *7 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/1/00/0000000001 while reading upstream, client: xxx.xxx.xxx.xxx, server: example.de, request: "GET /php/index.php?function=Album::getArchive&albumID=15015961245901&password= HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "example.de", referrer: "https://example.de/"
2017/12/15 13:27:59 [error] 22198#22198: *7 readv() failed (104: Connection reset by peer) while reading upstream, client: xxx.xxx.xxx.xxx, server: example.de, request: "GET /php/index.php?function=Album::getArchive&albumID=15015961245901&password= HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "example.de", referrer: "example.de"
FPM error.log :
WARNING: [pool www] child 22223, script '/var/www/lychee/php/index.php' (request: "GET /php/index.php?function=Album::getArchive&albumID=150145645645901&password=") execution timed out (148.539892 sec), terminating
[15-Dec-2017 13:23:23] WARNING: [pool www] child 22223 exited on signal 15 (SIGTERM) after 160.008470 seconds from start
[15-Dec-2017 13:23:23] NOTICE: [pool www] child 22270 started