Nginx – client_max_body_size is invalid to SSL configuration

When I set client_max_body_size to 30m; everything works fine without ssl (accepts files up to 30MB). However, when I switch to ssl, it completely ignores this instruction.

My configuration is as follows (/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 some suggestions here nginx – client_max_body_size has no effect, but no effect. I Trying to use different nginx versions, I set client_max_body_size for all blocks: http, server, location but nothing works.

I have also searched whether it is a nginx bug with no results.

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

My configuration is:

> AWS EC2 nano instance
>Docker’s Nginx (latest stable version-1.10.1)
>Single IP There is only one virtual host on the address

The difference with this question nginx – client_max_body_size has no effect: This question is related to ssl

Edit:
I am on nginx wiki https:// A question was created in trac.nginx.org/nginx/ticket/1076#ticket

I finally Found the cause of this problem. Nginx is working fine, but I routed the request to AWS Elastic Beanstalk, which uses nginx internally to route the request to the inside of the Docker container.

So, the misconfiguration is In terms of AWS Elastic Beanstalk. Configure AWS to fix the problem.

When I set client_max_body_size 30m; without ssl everything works fine (accepts files up to 30MB). However, when I switch When it came to ssl, it completely ignored this command.

My configuration is as follows (/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;
}< br />}

I found some suggestions here nginx – client_max_body_size has no effect, but no effect. I tried to use a different nginx version, I set client_max_body_size for all blocks: http, server, Location but no effect.

I also searched if it is a nginx bug with no results.

Is there any solution I can overcome this problem, or am I forced to use non ssl connection? Any suggestions are welcome.

My configuration is:

> AWS EC2 nano instance
>Docker’s Nginx (latest stable version-1.10.1)
>Single IP There is only one virtual host on the address

The difference with this question nginx – client_max_body_size has no effect: This question is related to ssl

Edit:
I am on nginx wiki https:// A problem was created in trac.nginx.org/nginx/ticket/1076#ticket

I finally found the cause of this problem. Nginx works fine, but I routed the request to AWS Elastic Beanstalk, which used nginx internally to route the request to the inside of the Docker container.

So, the misconfiguration was on the AWS Elastic Beanstalk side. Configuring AWS fixed the problem.

Leave a Comment

Your email address will not be published.