nextcloud / nextcloud/helm

Preserving Source IP and webdav request conflict

Open
#734 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go Template
Stars
534
Forks
314
Avg merge
42m
Merged PRs (30d)
1

Description

Describe your Issue

Hi,

I am trying to set up WebDAV for Zotero, but I am running into an issue with ingress and CORS settings.

  • The deployment uses image.flavor: apache.
  • I followed the recommended settings: preserve the source IP and support CORS.
  • My current ingress annotations:
ingress:
  annotations:
   nginx.ingress.kubernetes.io/enable-cors: "true"
   nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For"

With this config, when Zotero or I use an OPTIONS request (for WebDAV capability check), the response is processed directly by the ingress (HTTP 204), and the request does not reach the backend (Nextcloud).
As a result, Zotero cannot detect the WebDAV capabilities correctly, since the WebDAV-specific headers (like DAV:) are not provided as expected. Though I can correctly synchronize webdav files, zotero must firstly do this step for checking before synchronizing.

Here is the curl test:

···bash
curl -i -X OPTIONS https://NEXTCLOUD-URL/remote.php/dav/files/USERNAME
···
Output

HTTP/2 204
...
access-control-allow-methods: GET, PUT, POST, DELETE, PATCH, OPTIONS, PROPFIND, PROPPATCH, COPY, MOVE, LOCK, UNLOCK
access-control-allow-headers: X-Forwarded-For
...

Question:
How should I configure ingress-nginx so that:

  • CORS is enabled,

  • Source IP is preserved,

  • AND the OPTIONS/WebDAV capability requests are actually forwarded to the backend (not intercepted by the ingress), so the WebDAV headers are correctly returned?

Any help is much appreciated!

Describe your Environment

  • Kubernetes distribution: rke2

  • Helm Version (or App that manages helm): it's independent to helm version

  • Helm Chart Version: it's independent to helm chart version

  • values.yaml:

# paste your values.yaml (anonymize any sensitive data)

Additional context, if any

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ingress annotations and the curl OPTIONS request shown in the issue, then trace how ingress-nginx handles CORS preflight requests for the Nextcloud WebDAV endpoint. Done means identifying a configuration that preserves the source IP, keeps CORS enabled, forwards OPTIONS to the backend, and returns the expected WebDAV headers.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, helm, kubernetes, nginx
Domain
infrastructure, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.