404 Error when writing files to NextCloud on 3rd party server (WebDAV)

Nextcloud version (eg, 10.0.2): 12.0.2.
Operating system and version (eg, Ubuntu 16.04): Ubuntu 16.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.18
PHP version (eg, 5.6): 7.0.22
Is this the first time you’ve seen this error?: Yes

Can you reliably replicate it? (If so, please outline steps): No

The issue you are facing:

We are creating folders and writing pdf files to NextCloud via WebDAV. When using nextcloud (https://demo.nextcloud.com/) WebDAV on demo server it works as it should, but when trying use it on 3rd party server (Ubuntu OS) getting 404 error.

Sending request via java library Sardina. Web version for this server works.

The funny thing is that on a different 3rd party server (with Cent OS) everything works.

Can someone help us to figure out the problem with our Ubuntu server?

The output of your Nextcloud log in Admin > Logging:


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


The output of your Apache/nginx/system log in /var/log/____: