Err_ssl_protocol_error with nextcloud

1. The problem I’m having:

i use a reverse proxy for use with nextcloud.
as soon as I connect to my site, I get an error:
“ERR_SSL_PROTOCOL_ERROR”

2. Error messages and/or full log output:

<?xml version="1.0" encoding="UTF-8"?> root@deb-caddy:/etc/caddy# caddy run --config Caddyfile  
2025/06/29 19:12:23.275  INFO  maxprocs: Leaving GOMAXPROCS=1: CPU quota undefined  
2025/06/29 19:12:23.275  INFO  GOMEMLIMIT is updated  {"package": "github.com/KimMachineGun/automemlimit/memlimit", "GOMEMLIMIT": 912911155, "previous": 9223372036854775807}  
2025/06/29 19:12:23.276  INFO  using config from file  {"file": "Caddyfile"}  
2025/06/29 19:12:23.276  INFO  adapted config to JSON  {"adapter": "caddyfile"}  
2025/06/29 19:12:23.277  WARN  Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies  {"adapter": "caddyfile", "file": "Caddyfile", "line": 2}  
2025/06/29 19:12:23.278  INFO  admin  admin endpoint started  {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}  
2025/06/29 19:12:23.278  INFO  http.auto_https  automatic HTTPS is completely disabled for server  {"server_name": "srv0"}  
2025/06/29 19:12:23.279  DEBUG  http.auto_https  adjusted config  {"tls": {"automation":{"policies":[{}]}}, "http": {"servers":{"srv0":{"listen":[":443"],"routes":[{"handle":[{"handler":"subroute","routes":[{"hand  
le":[{"handler":"static_response","headers":{"Location":["/remote.php/carddav"]},"status_code":301}],"match":[{"path":["/.well-known/carddav"]}]},{"handle":[{"handler":"static_response","headers":{"Location":["/  
remote.php/caldav"]},"status_code":301}],"match":[{"path":["/.well-known/caldav"]}]},{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"192.168.1.41:10443"}]}]}]}],"terminal":true}],"tls_connection_poli  
cies":[{}],"automatic_https":{"disable":true}}}}}  
2025/06/29 19:12:23.279  DEBUG  http  starting server loop  {"address": "[::]:443", "tls": true, "http3": false}  
2025/06/29 19:12:23.279  INFO  http  enabling HTTP/3 listener  {"addr": ":443"}  
2025/06/29 19:12:23.279  INFO  http.log  server running  {"name": "srv0", "protocols": ["h1", "h2", "h3"]}  
2025/06/29 19:12:23.279  DEBUG  events  event  {"name": "started", "id": "dd55a681-e2fb-46a9-aff7-ff60b8c4063f", "origin": "", "data": null}  
2025/06/29 19:12:23.279  INFO  autosaved config (load with --resume flag)  {"file": "/root/.config/caddy/autosave.json"}  
2025/06/29 19:12:23.279  INFO  serving initial configuration  
2025/06/29 19:12:23.282  INFO  tls  storage cleaning happened too recently; skipping for now  {"storage": "FileStorage:/root/.local/share/caddy", "instance": "760266ca-3588-4a8f-b4bd-321e4f94f692", "tr  
y_again": "2025/06/30 19:12:23.282", "try_again_in": 86399.999999567}  
2025/06/29 19:12:23.282  INFO  tls  finished cleaning storage units  
2025/06/29 19:12:23.282  INFO  tls.cache.maintenance  started background certificate maintenance  {"cache": "0xc0002cc600"}  
2025/06/29 19:12:34.561  DEBUG  events  event  {"name": "tls_get_certificate", "id": "2279e662-214f-4f23-ad92-8d93ae8d24a7", "origin": "tls", "data": {"client_hello":{"CipherSuites":[4865,4866,4867],"ServerName  
":"mydomain.dedyn.io","SupportedCurves":[4588,29,23,24],"SupportedPoints":null,"SignatureSchemes":[1027,2052,1025,1283,2053,1281,2054,1537,513],"SupportedProtos":["h3"],"SupportedVersions":[772],"RemoteAddr":{"IP  
":"192.168.1.16","Port":35323,"Zone":""},"LocalAddr":{"IP":"192.168.1.42","Port":443,"Zone":""}}}}  
2025/06/29 19:12:34.563  DEBUG  tls.handshake  no matching certificates and no custom selection logic  {"identifier": "mydomain.dedyn.io"}  
2025/06/29 19:12:34.563  DEBUG  tls.handshake  no matching certificates and no custom selection logic  {"identifier": "*.dedyn.io"}

3. Caddy version:

v2.10.0

4. How I installed and ran Caddy:

a. System environment:

Debian Version 13

b. Command:

caddy run --config Caddyfile

d. My complete Caddy config:

{  
auto_https off  
debug  
}  
  
mydomain.dedyn.io {  
reverse_proxy 192.168.1.41:10443  
  
redir /.well-known/carddav /remote.php/carddav 301  
redir /.well-known/caldav /remote.php/caldav 301  
}

it is working.

I removed the ssl on the destination server.