To fix the error “client intended to send too large body: xyz bytes” in Nginx, you can increase the client_max_body_size value in the Nginx configuration file. The default value is often set to 1MB, but you can increase it to match your needs.
Here’s how you can make the change:
- Open the Nginx configuration file using a text editor:
sudo nano /etc/nginx/nginx.conf
- Look for the
http
block and add or modify theclient_max_body_size
value:http {
...
client_max_body_size 100M;
...
}
- Save the file and exit the editor.
- Reload Nginx to apply the changes:
sudo nginx -s reload
- Test the changes by making a request that previously caused the error.
Note: The location of the Nginx configuration file may differ based on your distribution and setup. Also, make sure to increase the client_max_body_size
value to a reasonable value that meets your needs.