"405 Not Allowed" when uploading, editing or removing files

Hello,

We have a problem with a server installed for a client of ours.
Files that are already on the server can be downloaded without any problems, but when trying to upload a new file or rename or delete an existing one, the following error appears: 405 Not Allowed
We have already checked the htaccess file, folder permissions, responses in other topics on this forum, etc. and nothing worked. Could you help us with that?

Server configuration:
Web server: cPanel - Apache/2.4.43 and NGINX
Database: MySQL Ver 15.1 Distrib 10.1.46-MariaDB, for Linux (x86_64) using readline 5.1
OS: Linux [CloudLinux 7.8 x86_64]
PHP: 7.3.20 - php-fpm
Anti-malware: Imunify360, ModSecurity
Browser: Google Chrome v85.0.4183.102

ownCloud version: 10.4.0.4 [fresh install]
Edition: Community
APPs Enabled:

  • comments: 0.3.0
  • configreport: 0.2.0
  • dav: 0.5.0
  • federatedfilesharing: 0.5.0
  • files: 1.5.2
  • files_external: 0.7.1
  • files_mediaviewer: 1.0.2
  • files_sharing: 0.12.0
  • files_trashbin: 0.9.1
  • files_versions: 1.3.0
  • firstrunwizard: 1.2.0
  • notifications: 0.5.0
  • provisioning_api: 0.5.0
  • systemtags: 0.3.0
  • theme: 19.03.13

Last Log Records:

{"reqId":"X2EYV1nXqR7oM7upGjrsaQAAAAo","level":0,"time":"2020-09-15T19:39:03+00:00","remoteAddr":"179.109.81.108","user":"admin","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"token 65eb2aaea2860248fca7552bf97510fd4364d968dffb216d803a0c1781df12ad9c4aa281a52db22937e7d727fded387114df9f8ea536059a1710f6208b796b50 with token id 214 found, validating"}
{"reqId":"X2EYV1nXqR7oM7upGjrsaQAAAAo","level":0,"time":"2020-09-15T19:39:03+00:00","remoteAddr":"179.109.81.108","user":"admin","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"token 65eb2aaea2860248fca7552bf97510fd4364d968dffb216d803a0c1781df12ad9c4aa281a52db22937e7d727fded387114df9f8ea536059a1710f6208b796b50 with token id 214 found, validating"}
{"reqId":"X2EYXoSx34SeZYKt1U5A@gAAABE","level":0,"time":"2020-09-15T19:39:11+00:00","remoteAddr":"179.109.81.108","user":"admin","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"token 65eb2aaea2860248fca7552bf97510fd4364d968dffb216d803a0c1781df12ad9c4aa281a52db22937e7d727fded387114df9f8ea536059a1710f6208b796b50 with token id 214 found, validating"}
{"reqId":"X2EYXoSx34SeZYKt1U5A@gAAABE","level":0,"time":"2020-09-15T19:39:11+00:00","remoteAddr":"179.109.81.108","user":"admin","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"token 65eb2aaea2860248fca7552bf97510fd4364d968dffb216d803a0c1781df12ad9c4aa281a52db22937e7d727fded387114df9f8ea536059a1710f6208b796b50 with token id 214 found, validating"}
{"reqId":"X2EYdZpgrTgqRZHueIiXaQAAAA8","level":0,"time":"2020-09-15T19:39:33+00:00","remoteAddr":"179.109.81.108","user":"admin","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"token 65eb2aaea2860248fca7552bf97510fd4364d968dffb216d803a0c1781df12ad9c4aa281a52db22937e7d727fded387114df9f8ea536059a1710f6208b796b50 with token id 214 found, validating"}
{"reqId":"X2EYdZpgrTgqRZHueIiXaQAAAA8","level":0,"time":"2020-09-15T19:39:33+00:00","remoteAddr":"179.109.81.108","user":"admin","app":"OC\\Authentication\\Token\\DefaultTokenProvider::updateTokenActivity","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"updating activity of token 214 to 1600198773"}
{"reqId":"X2EYdZpgrTgqRZHueIiXaQAAAA8","level":0,"time":"2020-09-15T19:39:33+00:00","remoteAddr":"179.109.81.108","user":"admin","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v2.php\/apps\/notifications\/api\/v1\/notifications?format=json","message":"token 65eb2aaea2860248fca7552bf97510fd4364d968dffb216d803a0c1781df12ad9c4aa281a52db22937e7d727fded387114df9f8ea536059a1710f6208b796b50 with token id 214 found, validating"}

/index.php/settings/integrity/failed:
No errors have been found.

The content of config/config.php:

{
    "system": {
        "instanceid": "ocfg2qzzyx9c",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "subdomain.domain.com.br",
            "domain.com.br"
        ],
        "datadirectory": "\/home\/user\/subdomain.domain.com.br\/data",
        "overwrite.cli.url": "http:\/\/subdomain.domain.com.br",
        "dbtype": "sqlite3",
        "version": "10.4.0.4",
        "logtimezone": "UTC",
        "apps_paths": [
            {
                "path": "\/home\/user\/subdomain.domain.com.br\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/home\/user\/subdomain.domain.com.br\/apps-external",
                "url": "\/apps-external",
                "writable": true
            }
        ],
        "integrity.excluded.files": [
            ".htaccess",
            ".user.ini"
        ],
        "integrity.ignore.missing.app.signature": [
            "theme-sevensi"
        ],
        "skeletondirectory": "\/home\/user\/subdomain.domain.com.br\/.skeleton",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": "1",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpport": "587",
        "maintenance": false,
        "loglevel": 0
    }
}

Chrome console log

jquery.min.js?v=f43c…4ae9703b33ceb11af:4 PUT http://subdomain.domain.com.br/remote.php/dav/files/admin/bashref-ed.4.3-pt_BR.pdf 405 (Not Allowed)
file-upload.js?v=f43…e9703b33ceb11af:411 Uncaught TypeError: Cannot read property 'documentElement' of undefined
    at OC.FileUpload.getResponse (file-upload.js?v=f43…e9703b33ceb11af:411)
    at HTMLInputElement.fail (file-upload.js?v=f43…9703b33ceb11af:1224)
    at $.<computed>.<computed>._trigger (jquery-ui.custom.js?…e9703b33ceb11af:789)
    at $.<computed>.<computed>._onFail (jquery.fileupload.js…e9703b33ceb11af:928)
    at $.<computed>.<computed>._onFail (jquery-ui.custom.js?…e9703b33ceb11af:405)
    at Object.<anonymous> (jquery.fileupload.js…e9703b33ceb11af:962)
    at j (jquery.min.js?v=f43c…4ae9703b33ceb11af:2)
    at Object.fireWith [as rejectWith] (jquery.min.js?v=f43c…4ae9703b33ceb11af:2)
    at x (jquery.min.js?v=f43c…4ae9703b33ceb11af:4)
    at XMLHttpRequest.<anonymous> (jquery.min.js?v=f43c…4ae9703b33ceb11af:4)
```
​
There are screenshots of the errors attached.

![1|690x185](upload://yaKPomCcCcM6elMcuxn3W7Vcwn3.jpeg)

Hey,

i did a search like https://central.owncloud.org/search?q="405"%20"Not%20Allowed" and stumbled on a reply about the following FAQ which seems to contain various information which could help to find the correct configuration of the web server:

If i’m understanding it correctly ownCloud requires special HTTP methods for e.g. uploading or deleting files and the web server underneath ownCloud doesn’t allow ownCloud to use that methods.