The long answer for the whole process, hope this helps:
The problem is service discovery. If you use a reverse proxy (nginx proxy manager in my case), then you need to add a redirecting code.
- CalDav and CardDav iOS issues - #4 by v1001001p
- Include link to service discovery trouble shooting in iOS sync guide by networkException · Pull Request #8318 · nextcloud/documentation · GitHub
- https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#service-discovery
- [CalDAV and Apple] Impossible to use CalDAV with Mac and iOS - #5 by drag
- https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
-
How to forward a location to another location? · Issue #2093 · NginxProxyManager/nginx-proxy-manager · GitHub
Note: Browser redirection works, but for iOS clients you must set up the rules in the reverse proxy manager, otherwise it will just refuse to redirect for some reason. You can also just manually enter the redirected address if you need a quick fix.