HTTP 405 error with Apple Calendar (nginx + proxy_pass + nextcloud 22)


I have a fresh install of nextcloud 22.1.0 on a Ubuntu 20.04-1 server.

This nextcloud instance is under nginx and is behind a nginx proxy server
www —> nginx proxy —> nginx applicative —> nextcloud

I use https (force redirect http to https) managed by certbot / Let’s encrypt.

I think that the configuration of the 2 nginx is quite good because all is working well with :

  • web browsers
  • desktop client under Ubuntu Desktop (sync ok)
  • Contacts sync with Thunderbird via TbSync plugin
  • desktop client under Mac OS (Big Sure)

BUT it is impossible to configure the Apple Calendar application. Under Mac OS Big Sure nore Mojave).

The Apple Calendar says : “could not check user or password”, after a few seconds.
I choose to create an “advanced configuration”
And “/remote.php/dav/principals/users/USERNAME” because it works for the Thunderbird plugin and it was the same path on my previous owncloud server.

In the nginx logs we can always see the same patern :

"PROPFIND /.well-known/caldav HTTP/1.0" 301 169 "-" "Mac+OS+X/10.15.7 (19H1217) accountsd/113"
"PROPFIND / HTTP/1.0" 405 157 "-" "Mac+OS+X/10.15.7 (19H1217) accountsd/113"
"PROPFIND /caldav/v2 HTTP/1.0" 405 0 "-" "Mac+OS+X/10.15.7 (19H1217) accountsd/113"
"PROPFIND /principals/users/USERNAME/ HTTP/1.0" 405 0 "-" "Mac+OS+X/10.15.7 (19H1217) accountsd/113"
"PROPFIND /principals/ HTTP/1.0" 405 0 "-" "Mac+OS+X/10.15.7 (19H1217) accountsd/113"
"PROPFIND /dav/principals/ HTTP/1.0" 405 0 "-" "Mac+OS+X/10.15.7 (19H1217) accountsd/113"

accountsd/113 is the “internet accounts” setup application client.

I searched a long time in this support forum but any advice works. Maybe messages are too older ?

Do anyone knows how to configure correctly Apple Calendar ?
Did I miss something on the server side configuration ?

Thank you.

This looks like service discovery is not configured as it should.


should redirect to (nextcloud in webroot):


or to (Nextcloud in a subdirectory):


In your case the redirect goes to:


After fixing that, I would recommend to first delete the falsely configured account from macOS and then to follow the documentation to add the account to macOS.

My server-log, when adding an account (macOS 11.5.2, Nextcloud 22.1.1 in webroot): - - [29/Aug/2021:08:25:52 +0200] "PROPFIND /.well-known/caldav HTTP/1.1" 301 178 "-" "macOS/11.5.2 (20G95) accountsd/113" - - [29/Aug/2021:08:25:53 +0200] "PROPFIND /remote.php/dav/ HTTP/1.1" 401 569 "-" "macOS/11.5.2 (20G95) accountsd/113" - dummy [29/Aug/2021:08:25:55 +0200] "PROPFIND /remote.php/dav/ HTTP/1.1" 207 263 "-" "macOS/11.5.2 (20G95) accountsd/113" - dummy [29/Aug/2021:08:25:57 +0200] "OPTIONS /remote.php/dav/principals/users/dummy/ HTTP/1.1" 200 0 "-" "macOS/11.5.2 (20G95) accountsd/113" - - [29/Aug/2021:08:25:57 +0200] "PROPFIND /remote.php/dav/principals/users/dummy/ HTTP/1.1" 401 569 "-" "macOS/11.5.2 (20G95) CalendarAgent/954" - dummy [29/Aug/2021:08:26:00 +0200] "PROPFIND /remote.php/dav/principals/users/dummy/ HTTP/1.1" 207 283 "-" "macOS/11.5.2 (20G95) CalendarAgent/954" - dummy [29/Aug/2021:08:26:00 +0200] "PROPFIND /remote.php/dav/principals/users/dummy/ HTTP/1.1" 207 537 "-" "macOS/11.5.2 (20G95) CalendarAgent/954" - dummy [29/Aug/2021:08:26:02 +0200] "OPTIONS /remote.php/dav/principals/users/dummy/ HTTP/1.1" 200 0 "-" "macOS/11.5.2 (20G95) CalendarAgent/954"