nginx断点续传问题求助

26次阅读

共计 1245 个字符,预计需要花费 4 分钟才能阅读完成。

我通过以下配置开启了 nginx 自带的文件列表功能,
location ^~/download {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    autoindex on;                    
    autoindex_exact_size off;      
    autoindex_localtime on;
    charset utf-8,gbk;
    alias /data
}
nginx 自带的文件列表功能 FDM 提示不能断点续传,IDM 又提示可以断点续传,浏览器上面下载短时间断开下载可以断点续传,如果长时间断开下载再继续就会提示网络错误,curl 携带 range 头请求了一下文件,第一次返回 200,第一次返回 206,第三次又返回 200,使用 alist 文件列表程序本地存储做对照,三次均返回 206。如果 nginx 文件列表支持断点续传三次请求均应该返回 206,但它只返回了一次,就很离谱,想换成 alist 但它不抗高并发,连接数一大下载就死了,还得使用原生 nginx 列表, 是我的配置有问题吗?万能的 MJJ 也没有上面解决办法。
curl http://mysite.com/rar -i -H “Range: bytes=2024-64569”
HTTP/1.1 200 OK
Date: Thu, 23 May 2024 10:47:00 GMT
Content-Type: application/x-rar-compressed
Content-Length: 1836766698
Connection: keep-alive
Last-Modified: Wed, 19 Oct 2022 07:50:26 GMT
ETag: “6d7ad5ea-5eb5e76321480”
Cache-Control: max-age=691200
HTTP/1.1 206 Partial Content
Date: Thu, 23 May 2024 10:47:30 GMT
Content-Type: application/x-rar-compressed
Content-Length: 62546
Connection: keep-alive
Last-Modified: Wed, 19 Oct 2022 07:50:26 GMT
ETag: “6d7ad5ea-5eb5e76321480”
Content-Range: bytes 2024-64569/1836766698
Cache-Control: max-age=691200
HTTP/1.1 200 OK
Date: Thu, 23 May 2024 10:47:46 GMT
Content-Type: application/x-rar-compressed
Content-Length: 1836766698
Connection: keep-alive
Last-Modified: Wed, 19 Oct 2022 07:50:26 GMT
ETag: “6d7ad5ea-5eb5e76321480”
Cache-Control: max-age=691200

正文完
 0