I had this same error. In case anyone finds this, let me add my two cents as well.
Unfortunately, the error I got within Cockpit simply said “Something Went Wrong” while i was uploading a file. Not very helpful.
I went to my Nginx error log file and saw this message:
*10899 client intended to send too large body: 3082436 bytes, client: <IP address>, server: <myserver.com> request: “POST
This means that I am trying to upload a file that is too large. I am uploading a 3M+ image and it is too large.
There are many places in your configuration that restrict upload limits. You can only upload a file as large as the smallest limit. So if your
php.ini file is set to 100Mb, but your Nginx is only set to 2Mb, then you can only upload 2Mb.
So you need to make sure all the places are set to what you want.
Here is a list to check:
- In your
- In your nginx.conf
- In your
/etc/nginx/sites-available/ you might have another configuration file overwriting the general nginx.conf so change it there too.
client_max_body_size 20M in your server block somewhere (but outside of a location block)
Now you can restart BOTH php-fpm if you updated the php.ini file, AND restart Nginx if you changed stuff there, for it to take place. If you still have problems, maybe restart your whole server to make sure everything “takes”.
On ubuntu you can
service nginx restart and
service php-fpm restart. Depending on your system, the php-fpm might not work because it is locked to a version of php. So instead use
service php7.3-fpm restart (obviously rotate out your specific php version if you are using something other than 7.3.
Hope that helps. Uploads start working.