When I set client_max_body_size 30m;
without ssl everything works (files up to 30MB 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've tries to use diferent nginx versions, I set client_max_body_size for all blocks: http, server, location but nothing works.
I've also searched if it is an nginx bug with no results.
Is there any solution I can overcome the problem or am I forced to use non-ssl connection? Any suggestions are welcomed.
My configuration is:
Difference from this question nginx - client_max_body_size has no effect: this question is related to ssl
Edit: I've created an issue in nginx wiki https://trac.nginx.org/nginx/ticket/1076#ticket
I finally found the cause of this problem. Nginx works correctly, however I routed requests to AWS Elastic Beanstalk which uses nginx internally to route requests to inside Docker container.
So the misconfiguration was on the side of AWS Elastic Beanstalk. Configuring the AWS fixed the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With