<p>I am trying to mount a remote webdav:</p>
<p><code>sudo mount -t davfs https://files.isric.org/soilgrids/latest/data/  ~/webdav</code></p>
<p>But I only get the following error: <code>/sbin/mount.davfs: mounting failed; the server does not support WebDAV</code></p>
<p>This server is a <a href="https://github.com/mar10/wsgidav" rel="nofollow noreferrer">wsgidav</a> running in a kubernetes cluster.</p>
<p>Same problem with nautilus, using <code>gvfsd-dav</code> to debug the problem as indicated <a href="https://forum.manjaro.org/t/webdav-folder-will-not-mount-in-nautilus/109948/4" rel="nofollow noreferrer">here</a>. I've the following HTTP requests/responses from the server:</p>
<pre><code>/usr/libexec/gvfsd-dav ssl=true user=anonymous host=files.isric.org  prefix=/soilgrids/latest/data/
dav: setting 'ssl' to 'true'
dav: setting 'user' to 'anonymous'
dav: setting 'host' to 'files.isric.org'
dav: setting 'prefix' to '/soilgrids/latest/data/'
dav: Added new job source 0x556590e0c1a0 (GVfsBackendDav)
dav: Queued new job 0x556590e0a380 (GVfsJobMount)
dav: + mount
&gt; OPTIONS /soilgrids/latest/data HTTP/1.1
&gt; Soup-Debug-Timestamp: 1657091152
&gt; Soup-Debug: SoupSession 1 (0x556590e0c100), SoupMessage 1 (0x7fa1b40060e0), SoupSocket 1 (0x7fa1b43440e0)
&gt; Host: files.isric.org
&gt; Accept-Encoding: gzip, deflate
&gt; User-Agent: gvfs/1.48.2
&gt; Accept-Language: en-us, en;q=0.9
&gt; Connection: Keep-Alive
  
&lt; HTTP/1.1 204 No Content
&lt; Soup-Debug-Timestamp: 1657091152
&lt; Soup-Debug: SoupMessage 1 (0x7fa1b40060e0)
&lt; Date: Wed, 06 Jul 2022 07:05:52 GMT
&lt; Connection: keep-alive
&lt; Strict-Transport-Security: max-age=15724800; includeSubDomains
&lt; Access-Control-Allow-Origin: *
&lt; Access-Control-Allow-Credentials: true
&lt; Access-Control-Allow-Methods: GET, OPTIONS, HEAD
&lt; Access-Control-Allow-Headers: Content-Type, Accept-Ranges, Content-Range, Range, Content-Encoding, Content-Length, Access-Control-Allow-Origin
&lt; Access-Control-Max-Age: 1728000
&lt; Content-Length: 0
&lt; 
  
dav: send_reply(0x556590e0a380), failed=1 (Not a WebDAV enabled share)
dav: Mount failed: Not a WebDAV enabled share
</code></pre>
<p>The server HTTP response is <code>HTTP/1.1 204 No Content</code></p>

<p>The problem lies on the k8s ingress that has:</p>
<pre><code>apiVersion: networking.k8s.io/v1 
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/enable-cors: &quot;true&quot;
    nginx.ingress.kubernetes.io/cors-allow-methods: &quot;GET, OPTIONS, HEAD&quot;
    nginx.ingress.kubernetes.io/cors-allow-headers: &quot;Content-Type, Accept-Ranges, Content-Range, Range, Content-Encoding, Content-Length, Access-Control-Allow-Origin&quot;
</code></pre>
<p>The <code>HTTP/1.1 204 No Content</code> response is the correct <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204" rel="nofollow noreferrer">pre-flight CORS</a> response <strong>that is provided by the ingress</strong>, this is <strong>not the expected WebDAV reponse</strong>, and the first request was not even reaching the pod running wsgidav.</p>
<p>Solution: <strong>Disable CORS support on ingress</strong>. and then things are OK:</p>
<pre><code>/usr/libexec/gvfsd-dav ssl=true user=anonymous host=files.isric.org  prefix=/soilgrids/latest/data/
&gt; OPTIONS /soilgrids/latest/data HTTP/1.1
&gt; Soup-Debug-Timestamp: 1657095042
&gt; Soup-Debug: SoupSession 1 (0x55758f924100), SoupMessage 1 (0x7f01180060d0), SoupSocket 1 (0x7f0118342110)
&gt; Host: dev-files.isric.org
&gt; Accept-Encoding: gzip, deflate
&gt; User-Agent: gvfs/1.48.2
&gt; Accept-Language: en-us, en;q=0.9
&gt; Connection: Keep-Alive
  
&lt; HTTP/1.1 200 OK
&lt; Soup-Debug-Timestamp: 1657095042
&lt; Soup-Debug: SoupMessage 1 (0x7f01180060d0)
&lt; Date: Wed, 06 Jul 2022 08:10:42 GMT
&lt; Content-Type: text/html
&lt; Content-Length: 0
&lt; Connection: keep-alive
&lt; DAV: 1
&lt; Allow: OPTIONS, HEAD, GET, PROPFIND
&lt; MS-Author-Via: DAV
&lt; Strict-Transport-Security: max-age=15724800; includeSubDomains
&lt; 
</code></pre>
