I am using php-fpm, so what helped was:
modifying the .user.ini in your nextcloud install directory.
append:
upload_max_filesize=10G
post_max_size=10G
memory_limit=512M
of course you should adapt the values to fit your need.
afterwards restart your php fpm service and your web server service:
e.g.: sudo service php7.2-fpm restart && sudo service ngxin restart