0

Ok, I've seen all answers which as minimum mention such problem with nginx, so please. I just need to increase upload body size to 100 mb. So my setup is: simple AWS EC2 instance with 18.04 ubuntu with next /etc/nginx/nginx.conf:

http {
    ...
    client_max_body_size 100m;
}

And one of the sites /etc/nginx/sites-available/my-api.domain.ltd:

server {
    client_max_body_size 100m;

    location /media/upload {
        proxy_pass http://10.0.1.5:5000/media/upload;
        ...
        client_max_body_size 100m;
    }

As I assume all things done according docs and answers like that. Under the hood of http://10.0.1.5:5000 there is another one EC2 instance with dotnet core app started as Docker-container. All security groups, ports and other things are done: everything works, except the only one minor things which I can't fix the whole day! Even all client_max_body_size settings placed, the endpoint still can't handle requests with body more than 1 Mb!

Yes, I checked my dotnet app twice: it has default limit: 30 Mb for upload. So, please, try to show me the thing I missed because I'm stuck. Thank you.

matterai
  • 3,246
  • 4
  • 17
  • 29

1 Answers1

0

I've reviewed everything and finally figured out the problem. The problem was encountered in nginx which was placed in dokku on my 10.0.1.5 machine. It fixed with:

sudo echo 'client_max_body_size 100m;' > /home/dokku/app/nginx.conf.d/upload.conf

chown dokku:dokku /home/dokku/app/nginx.conf.d/upload.conf
matterai
  • 3,246
  • 4
  • 17
  • 29