Question

How to edit Nginx setting for big file upload

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)


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Great answer by @moisey!

Another thing to point out is that, this setting of “client_max_body_size” does not come included by default in the http section of the nginx.conf file. You have to add it manually in order to increase the setting to whatever number you need.

If the file is too large you may be running into nginx’s client_max_body_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.