[Solved] carddav on OS X 10.11(.6)

Took me a while but I solved not being able to sync carddav on my setup. Apologies if this has been covered before, I haven’t been it.

Preface: Running NC10 on docker/pi with nginx on a non-standard port, though this could help you solve like issues. Carddav never worked for me so every upgrade I spend some time to try again.

My situation is that whether adding an account for the Contacts > Prefs > Accounts or Sys Prefs > Internet Accounts and whether I chose Auto to Advanced, I got a ’ Cannot verify username and password ’ or some such error.

Anyhoo, I happened along to the error log for the accountsd process and it kept complaining about not being able to access the server using almost none of the details I was actually typing in. :rage:

Your details may differ but basically I took apart the address it was trying to hit and made redirects in docker. For me the error was,

... accountsd[482]: Could not verify credentials for account ... NSErrorFailingURLKey=https://<username>@<serverip>:8843/

Not sure why it would not honor my specific port and would only check root…

In the end all it took was a new block added in to nginx.conf,

server {
    listen 8443;
    server_name <servername>;
    location = /.well-known/carddav { return 301 $scheme://$host:<realport>/remote.php/dav; }
    location = /.well-known/caldav { return 301 $scheme://$host:<realport>/remote.php/dav; }

If you try this, please replace the and with the details of where your next cloud instance is running. The ‘listen 8443;’ in the nginx block is from the Mac console error log so if you look there and want to try this, please use that port number.