nginx error: “client intended to send too large body”

Last updated on | 3 replies

If you are trying to upload large files and are seeing this error in the nginx error log, it means the client_max_body_size value is too low.

Open the nginx configuration file:

sudo nano /etc/nginx/nginx.conf

It may also be located in /usr/local/nginx/conf/nginx.conf or /usr/local/etc/nginx/nginx.conf.

Add the following line within the http block

/etc/nginx/nginx.conf
http {
    . . .
    client_max_body_size 64M;
    . . .
} 

Save and exit (press CTRL + X, press Y and then press ENTER)

Now, check if the Nginx config file syntax is valid.

sudo nginx -t

If valid, restart Nginx service.

service nginx restart

You may also need to edit the php.ini configuration file.

Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.

3 replies

Leave a reply

Your email address will not be published. Required fields are marked *