J
J
JustAleksei2017-09-11 18:14:11
Django
JustAleksei, 2017-09-11 18:14:11

Why can't I increase client_max_body_size in nginx to increase file upload size?

I just can't understand why it is possible to reduce client_max_body_size less than the standard value of 1M, but it cannot be increased. Exploring similar questions on stackoverflow didn't help. All size settings greater than 1M have no effect.
ubuntu:16.04
nginx/1.10.3
$ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
/etc/nginx/nginx.conf
Test request code I make a POST to my.site.ru/api/ file where the Django/React app is located
UPDATE
1. Neither /var/log/nginx/access.log nor /var/log/nginx/error.log upload requests get there (there are other requests there)
2. Just in case , set in Django settings
FILE_UPLOAD_TEMP_DIR = '/tmp'
FILE_UPLOAD_PERMISSIONS = 0o777
FILE_UPLOAD_DIRECTORY_PERMISSIONS = FILE_UPLOAD_PERMISSIONS
3. Did chmod -R 777 /tmp

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Mukovoz, 2017-09-11
@castomi

Firstly, you don’t need to write this in each location separately, why did you get the idea that this limitation is a problem?
It is enough to register it once in http
What does nginx write to you in the log? What does it write in the access log, and what does it write in the error log?
https://djbook.ru/rel1.4/topics/http/file-uploads.html
Here, read about where the file is stored during the upload process and follow it. Check the permissions on the temp folder, maybe the django user just doesn't have enough permissions to write the file there.
Check if there is enough free space.

B
Boris Korobkov, 2017-09-11
@BorisKorobkov

Why do you think it's nginx? Perhaps he just skips large files, and someone else (Apache, PHP, Python, etc. - depending on what and how you have configured) blocks.
Read /var/log/nginx/*

J
JustAleksei, 2017-09-14
@JustAleksei

Problem solved. It turns out that HTTPS was implemented on another machine, where the second nginx was installed and on this second one it was necessary to specify your client_max_body_size

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question