This should be a quick fix. So for some reason I still can't get a request that is greater than 1MB to succeed without returning 413 Request Entity Too Large.
For example with the following configuration file and a request of size ~2MB, I get the following error message in my nginx error.log:
*1 client intended to send too large body: 2666685 bytes,
I have tried setting the configuration that is set below and then restarting my nginx server but I still get the 413 error. Is there anything I am doing wrong?
server {
listen 8080;
server_name *****/api; (*omitted*)
client_body_in_file_only clean;
client_body_buffer_size 32K;
charset utf-8;
client_max_body_size 500M;
sendfile on;
send_timeout 300s;
listen 443 ssl;
location / {
try_files $uri @(*omitted*);
}
location @parachute_server {
include uwsgi_params;
uwsgi_pass unix:/var/www/(*omitted*)/(*omitted*).sock;
}
}
Thank you in advance for the help!
Context: http , server , and location. This is the maximum size of a client request body. If this size is exceeded, Nginx returns a 413 Request entity too large HTTP error. This setting is particularly important if you are going to allow users to upload files to your server over HTTP.
The solution is to increase the client request size body by the client_max_body_size parameter in nginx. conf file. Following is the description of the client_max_body_size parameter. The default value is 1MB and you can set this to an HTTP, server or location contexts.
In the opened “/etc/nginx/nginx. conf” file, look for the line assigning the value to the “client_max_body_size” variable in the “http {}” section. You can add the “client_max_body_size” value manually if you cannot find it in the configuration file.
I'm surprised you haven't received a response but my hunch is you already have it set somewhere else in another config file.
Take a look at nginx - client_max_body_size has no effect
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