Background
We’re Installing Seafile Using Docker Compose and Employing Nginx for Reverse Proxy.
OS: Ubuntu 22.04.2 LTS Seafile Version: Docker Community Edition 8.0.7 Nginx Version: nginx/1.18.0 (Ubuntu)
Symptom
I am downloading large files in seafile with file size of 2.3GB and after some time it says download failed. But I can successfully download small files.
Analysis Process
Determine the direction of troubleshooting based on the phenomenon
- I’ve successfully downloaded many small files of a few tens of MB in the past, so I think the reason for the error has to do with the file size!
- First I tried to download another 1.5G file and it failed. Then I made several more attempts and found that the browser’s file download progress bar went close to 1GB with an error.
View nginx logs
- I started looking at the nginx error logs and saw the error logs.
1
upstream prematurely closed connection while reading upstream, client: 192.168.5.65...
- I’m downloading the file on the server without going through nginx, it worked fine. So I’ve decided the problem is with nginx.
- I tried to search
nginx download large file 1G
and found nginx-does-not-serve-large-files - I found
proxy_max_temp_file_size
andproxy_buffering
in ngx_http_proxy_module. then I confirmed the default size ofproxy_max_temp_file_size
is 1GB. I tried to set theproxy_max_temp_file_size 0;
andproxy_buffering off;
in the conf of nginx and download the file again. The file was successfully downloaded.
Solution
Change proxy_buffering off, add proxy_buffering off;
to the conf of nginx.
|
|