STEPS TO FIX IT:
Step 1: Open the nginx configuration file, example using “vi”.
sudo vi /etc/nginx/nginx.conf
Step 2: Adding new line (Or update old line if it is there) with your value.
- Set in “http” block which affects all server blocks (virtual hosts)
- Set in “server” block, which affects a particular site/app.
- Set in “location” block, which affects a particular directory (uploads) under a site/app.
- Setting size to 0 disables checking of client request body size.
Example on “http” block: limit to 50m
http {
...
client_max_body_size 50m;
}
Step 3: Reload Nginx (No need to restart)
sudo systemctl reload nginx
Now you’re able to upload file with max 50m. You can update the number as you want depends on how strong your your server 🙂
Leave a Reply