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.
thanks!
Thank you very much, helped my a lot!
Great! 🙂