I am using a fileuploadfield component to upload a file from browser to a NGINX server. File size is 3Gb. NGINX version is 1.12.0. I have the following NGINX config:
http {
server {
listen 443;
server_name SERVER_NAME_OR_IP;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log debug;
ssl on;
ssl_certificate /path/to/cert.crt;
ssl_certificate_key /path/to/cert.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location ~* /test/abcd/ {
client_max_body_size 3075m;
proxy_pass http://127.0.0.1:7000;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_address;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 127.0.0.1:7000;
server_name SERVER_NAME_OR_IP;
client_max_body_size 3075m;
location / {
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_VALUE "upload_max_filesize = 3075M \n
post_max_size=3075M";
include /etc/nginx/fastcgi_params;
}
}
}
The problem is that sometimes(it doesn't reproduce 100%), when I upload a 3Gb file, the nginx server writes partially the file in /tmp/ (it doesn't write a file with 3Gb size and every time it is a different size). After a while, in browser I get the error: 504 Gateway timeout and in PHP: upload failed with error 3. Do you know what might be the problem?
Thank you!