Nextcloud: well-known checks return error
Pre-requisite: Running Nextcloud in production with proxy/prod-le
When going to Settings > Administration > Overview, we can see the following message:
Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the documentation.
Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the documentation.
It seems to be related to Content Security Policy and the fact that NGINX is rewriting with $scheme which is HTTP and not HTTPS in the following part of nginx.conf
:
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
Replacing $scheme
by https
is working fine, but when running on localhost for test, it is not correct.
Other solution might be found here.
I tried to add this set of line in traefik.toml
but that might not be correct as it is not working:
[frontend]
[frontend.redirect]
permanent = true
regex = "https://(.*)/.well-known/(card|cal)dav"
replacement = "https://$$1/remote.php/dav/"
The only drawback is that traefik will always redirect even if nextcloud is not installed.
Any idea ?