Nginx proxy timeout while uploading big files
21,619
Solution 1
Probably nginx upstream timeout needs to be increased. Try adding below to your upstream conf.
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
Solution 2
Probably you need to change the limit at
client_max_body_size 5M;
to something like
client_max_body_size 10M;
Related videos on Youtube
Comments
-
tomekkup almost 2 years
I'm experiencing strange behaviour with Nginx. In my case Nginx acts as proxy to Jetty. Config below:
server { listen 80; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; client_max_body_size 5M; server_name test.com www.test.com location / { auth_basic "Restricted area"; auth_basic_user_file /etc/nginx/htpasswd; proxy_pass http://localhost:8080; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto http; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; gzip on; } }
When uploading a file with size greater than 5M I'm getting a'Gateway timeout'. CPU usage is 0%. I've no idea what's wrong. It's not related to a network speed because I'm testing this locally.
If I skip a proxy and try to upload file to app server directly (i mean: on port 8080), everything works like a charm.
Any idea ?? Regards!
-
tomekkup almost 12 yearsOK. but app server can handle files larger than 1GB and return exception bla bla bla.