How to edit Nginx setting for big file upload

December 18, 2017 7k views
Nginx Configuration Management Ubuntu 16.04

Hello,

I want to upload a big file (~600MB) from a local app to my server app which takes more than 10 minutes. However it seems that after 10 minutes - my connection get closed. What settings I should change on my server and how?

Server is using Nginx and Meteor.js (Node.js)

1 Answer

If the file is too large you may be running into nginx's clientmaxbody_size which if exceed should return a 413 error, though some browsers don't support actually reporting that error correctly.

You would want to increase this to a larger limit or set it to 0 in which case there will be no limits.

http {
    # [...]
    client_max_body_size 100m;
    # [...]
}

If that doesn't fix it you will want to tail your error logs for both nginx and meteor to see if you are getting something more specific and then provide that in your question as there maybe other factors at play.

Have another answer? Share your knowledge.