Webdav not working for Docker fpm Nextcloud container via Apache but works for Docker Apache Nextcloud container

I’m trying to access my calendar via webdav in my Nextcloud fpm Docker container but I keep getting prompted for credentials even after I enter them correctly. The server logs simply show: "PROPFIND /nextcloud/remote.php" 401

Here’s what I’ve done and tried:

  • Using Docker Compose
  • Set up a Nextcloud fpm Docker container (nextcloud:15.0.7-fpm-alpine)
  • Set up an Apache Docker container (httpd:2.4.38-alpine) that acts as a reverse proxy for the Nextcloud fpm container
  • Build the containers with Docker Compose, run the containers, and access the Nextcloud web interface setup.
  • I setup an administrator, add the official Calendar add-on, add a test calendar entry, and grab the webdav URL.
  • I plug the webdav URL into Mozilla Thunderbird’s Lightning network calendar wizard to add it as a remote calendar.
  • After I configure the remote calendar in Lightning, it prompts me for admin’s credentials, which I provide. However, every time I provide them, it prompts for them again and adds a log entry to the Nextcloud log file (401 shown above).
  • To try to isolate the issue, I changed the Nextcloud Docker container to a non-fpm one that has Apache built in (nextcloud:15.0.7-apache). I reconfigured my Apache container to act as a reverse proxy for the different Nextcloud container by using a different ProxyPass directive. I repeated the Nextcloud setup and attempt to access it from Lightning and that worked fine. So, the issue seems to be with my Apache reverse proxy and the Nextcloud fpm containers…but I can’t figure it out.

I’m thinking maybe a misconfiguration with the reverse proxy directive?
ProxyPassMatch ^/nextcloud/(.*\.php(/.*)?)$ fcgi://nextcloud:9000/var/www/html/$1
It works for everything else, so I’m not convinced that’s the problem.

Or maybe the fpm container doesn’t support webdav? Has anyone tried and confirmed that the fpm container does support webdav when used with Apache as a reverse proxy?

Any other suggestions for my problem?


I have a similar problem:
Nextcloud fpm: nextcloud:stable-fpm-alpine
Apache: webdevops/apache:alpine
Traefik for load-balancing and https management: traefik:latest

The web interface is functional but when I connect my Android smartphone with DAVx5 app to the /remote.php/dav, it send “PROPFIND /remote.php/dav/principals/users/***/ HTTP/1.1” 401.
I tried creating an app password, but the response is the same.

Is it an apache directive to add in order to access the webdav ?
Can someone help me please ?