Okay, so after some testing I still don’t know why the changes in htaccess disappear.
But on one server it works fine, and on the other it reports a 5 GB file size limit — no idea why.
At least normal uploads in the web interface now work.
However, all my previous tests failed because I was always testing with a shared link that has edit rights.
With that, I still get a 413 error and the following message:
BadRequest – Expected file size of 3099309687 bytes, but 0 bytes were read (from the Nextcloud client) and written (to the Nextcloud storage). This can be caused by a network issue on the sending side or a writing issue on the server side.
So it seems that the upload limit only works for regular logged-in uploads, but not for uploads via share links.
Any idea what might cause this difference? Guess this is a nextcloud issue.