I have tried adding port 80, port 443, transparent, tls_insecure_skip_verify, etc.
the closest I have gotten to success is an HTTP 502 error. I can successfully access nextcloud via the local IP. my nextcloud server was also able to obtain a letsencrypt certificate using certbot, and according to ssllabs.com my sub-domain has a proper certificate. I am able to access my main domain with https and it reads the default caddy splash page.
please help me… I have been beating my head against my keyboard for 3 days (not literally beating my head, but you get the idea).
You don’t need any of this stuff. Caddy sets the appropriate headers already, automatically. These lines will become a warning in the next version, so remove them.
If you make a request to your server with curl -v, what do you see? What does the redirect look like?
The redirect is almost certainly coming from Nextcloud. Make sure it’s correctly configured for being behind a proxy.
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>