Nginx - client_max_body_size does not affect ssl configuration

When I install client_max_body_size 30m;without ssl, everything works (files up to 30 MB are accepted). However, when I switch to ssl, it completely ignores this directive.

My configuration looks like (/etx/nginx/conf.d/my-sites.com.conf):

server {
  listen 443 ssl;
  server_name my-sites.com;
  ssl_certificate /etc/nginx/ssl/my-sites.com/uni_my-sites.com.crt;
  ssl_certificate_key /etc/nginx/ssl/my-sites.com/my-sites.com.key;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

  client_max_body_size 30m;

  location / {
    proxy_pass http://my-backend.com;
    proxy_set_header Host $host;
    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 $scheme;
  }
}

I found several suggestions here nginx - client_max_body_size has no effect , but nothing worked . I try to use different versions of nginx, I set client_max_body_size for all blocks: http, server, location, but nothing works.

I also searched if this is a nginx error without any results.

Is there any solution that I can solve, or am I forced to use a non-ssl connection? Any suggestions are welcome.

My configuration:

  • AWS EC2 nano Instance
  • Nginx ( - 1.10.1)
  • IP-

nginx - client_max_body_size : ssl

Edit: nginx wiki https://trac.nginx.org/nginx/ticket/1076#ticket

+4
1

- . Nginx , AWS Elastic Beanstalk, nginx Docker.

, AWS Elastic Beanstalk. AWS .

0

Source: https://habr.com/ru/post/1654685/


All Articles