问题原文
原帖链接 · Andrey · CC BY-SA 3.0
When trying to download a large file (not sure what size is enough, trying to download 5Gb), connection is stuck:
$ wget --verbose http://example.net/large.zip -O /dev/null
--2016-12-14 12:52:38-- http://example.net/large.zip
Resolving example.net (example.net)... 1.2.3.4
Connecting to example.net (example.net)|1.2.3.4|:80... connected.
HTTP request sent, awaiting response...
And this is going on forever, and by forever I mean 10 minutes at least.
nginx config for this kind of files:
location ~* ^.+\.(css|js|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
log_not_found off;
expires 7d;
}
Small static files (and by small I mean for example 50Mb ones) are served fine.
Turning access_log off; to "on" does not help, there is nothing in logs on this request.
Changing file type from zip to another type does not help.
The most strange thing is that if I start the download and after this restart nginx, the download starts just fine. But only this one. If you start another download after server restart, it doesn't work in the same way.
已采纳解答
原帖链接 · Andrey · CC BY-SA 3.0
Oops my mistake.
There was a CDN configured in front of this server. And it needed too much time to get those files completely before it started to serve them. That's why the download started instantly when I restarted nginx. CDN was giving the incomplete file.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
