Services discovery - CalDAV or CardDAV, etc

Hello,

My NextCloud installation is a bit non-standard - we have a HAProxy gateway which grabs the first word form the supplied URI, resolves it to internal DNS name and sends traffic to it - i.e. http request to https://cloud.domain.com/cloudbug/ will be send to internal HTTP server named cloudbug.internal.domain.tld, which has location called /cloudbug/ where NextCloud app resides. Path is preserved by NextCloud settings - so user always sees URL https://cloud.domain.com/cloudbug/ in his/her browser. This part works fine and I have NO issues with it.

I have an issue to make CalDAV or CardDAV clients working properly as it described here - https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#service-discovery

As you understand - proxy does not understands where to send traffic addressed to URL’s

  • https://cloud.domain.com/.well-known/carddav
  • https://cloud.domain.com/.well-known/caldav
  • https://cloud.domain.com/.well-known/webfinger

because NO server name given in URI. However CalDAV or CardDAV apps expects to get a proper response from there and returns an error.

Any ideas?
Thanks!

As usual I would recommend to ask aunt G. for help: Check out this:

https://www.google.com/search?q=extcloud+behind+haproxy+.well-known&oq=nextcloud+behind+haproxy+.well-known

As usual, I recommend to read people’s posts a bit more carefully, before sending them to Google. :slight_smile:

If you hit my any of below URL’s - there is will be no NextCloud to response

  • https://cloud.domain.com/.well-known/carddav
  • https://cloud.domain.com/.well-known/caldav
  • https://cloud.domain.com/.well-known/webfinger

However if you hit a URL like below:

  • https://cloud.domain.com/cloudbug/.well-known/carddav
  • https://cloud.domain.com/cloudbug/.well-known/caldav
  • https://cloud.domain.com/cloudbug/.well-known/webfinger

Nextcloud installed on internal cloudbug server will respond. We plan to have hundreds of similar backend servers behind HAproxy.

So, when I try a mobile CalDAV/CardDAV app connect to NextCloud URL https://cloud.domain.com/cloudbug/ - app expects to get a proper CalDAVCardDAV response from https://cloud.domain.com/.well-known/carddav BUT - HAproxy have NO idea where to dispatch this URL. In other words all my NextCloud servers shares the same domain name, but responds at different URI’s.

1 Like