Reverse proxy to nextcloud server not working

weell almost, but not quite… technically it worked, but I am having an issue that I think now is related to Caddy:

I am getting the following warnings in nextcloud, and I don’t quite know how to implement the fix for it (I already have the appropriate fix implemented on the nextcloud/apache side from here)

errors:
Your web server is not properly set up to resolve "/.well-known/caldav".
Your web server is not properly set up to resolve "/.well-known/carddav".
fix:
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^\.well-known/host-meta /nextcloud/public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /nextcloud/public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/webfinger /nextcloud/public.php?service=webfinger [QSA,L]
  RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav [R=301,L]
  RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav [R=301,L]
</IfModule>

I tried to apply the appropriate lines in this post:
https://caddy.community/t/dockerised-nextcloud-apache-web-server-behind-a-caddy-reverse-proxy/9367

redir /.well-known/carddav /remote.php/dav 301
redir /.well-known/caldav /remote.php/dav 301

but now I get a redirect error again ( I am aware that these are redirect calls, but I don’t understand how they are creating a redirect loop)

As I am sure you have noticed I am new to all of this. Thank you for your help!