sure:
1/ with (http):
# Caddyfile
{
debug
}
crios.bris.fr:6690 {
reverse_proxy http://192.168.9.201:6690
}
sudo caddy run
2023/01/05 12:48:36.973 INFO using adjacent Caddyfile
2023/01/05 12:48:36.985 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2023/01/05 12:48:36.989 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2023/01/05 12:48:36.997 INFO http enabling HTTP/3 listener {"addr": ":6690"}
2023/01/05 12:48:37.003 DEBUG http starting server loop {"address": "[::]:6690", "tls": true, "http3": true}
2023/01/05 12:48:37.008 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2023/01/05 12:48:37.014 DEBUG http starting server loop {"address": "[::]:80", "tls": false, "http3": false}
2023/01/05 12:48:37.018 INFO http.log server running {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2023/01/05 12:48:37.023 INFO http enabling automatic TLS certificate management {"domains": ["crios.bris.fr"]}
2023/01/05 12:48:36.993 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000189340"}
2023/01/05 12:48:36.998 INFO tls cleaning storage unit {"description": "FileStorage:/root/.local/share/caddy"}
2023/01/05 12:48:37.052 DEBUG tls loading managed certificate {"domain": "crios.bris.fr", "expiration": "2023/03/12 16:44:05.000", "issuer_key": "acme-v02.api.letsencrypt.org-directory", "storage": "FileStorage:/root/.local/share/caddy"}
2023/01/05 12:48:37.148 INFO tls finished cleaning storage units
2023/01/05 12:48:37.275 DEBUG tls.cache added certificate to cache {"subjects": ["crios.bris.fr"], "expiration": "2023/03/12 16:44:05.000", "managed": true, "issuer_key": "acme-v02.api.letsencrypt.org-directory", "hash": "a780dad0e16f4f95c1fa39d995aa6815e48cf68550b85e7243a08e3ad7293889", "cache_size": 1, "cache_capacity": 10000}
2023/01/05 12:48:37.282 DEBUG events event {"name": "cached_managed_cert", "id": "f7f8f1ca-339e-4aac-8a69-338e4d8683a1", "origin": "tls", "data": {"sans":["crios.bris.fr"]}}
2023/01/05 12:48:37.291 INFO autosaved config (load with --resume flag) {"file": "/root/.config/caddy/autosave.json"}
2023/01/05 12:48:37.296 INFO serving initial configuration
2023/01/05 12:49:13.193 DEBUG http.stdlib http: TLS handshake error from 192.168.9.1:54385: tls: first record does not look like a TLS handshake
2/ with (https):
{
debug
}
crios.bris.fr:6690 {
reverse_proxy https://192.168.9.201:6690
}
sudo caddy run
2023/01/05 12:51:25.423 INFO using adjacent Caddyfile
2023/01/05 12:51:25.450 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2023/01/05 12:51:25.454 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2023/01/05 12:51:25.462 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc00036d340"}
2023/01/05 12:51:25.465 DEBUG http starting server loop {"address": "[::]:80", "tls": false, "http3": false}
2023/01/05 12:51:25.468 INFO http.log server running {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2023/01/05 12:51:25.471 INFO http enabling HTTP/3 listener {"addr": ":6690"}
2023/01/05 12:51:25.475 DEBUG http starting server loop {"address": "[::]:6690", "tls": true, "http3": true}
2023/01/05 12:51:25.478 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2023/01/05 12:51:25.485 INFO http enabling automatic TLS certificate management {"domains": ["crios.bris.fr"]}
2023/01/05 12:51:25.496 DEBUG tls loading managed certificate {"domain": "crios.bris.fr", "expiration": "2023/03/12 16:44:05.000", "issuer_key": "acme-v02.api.letsencrypt.org-directory", "storage": "FileStorage:/root/.local/share/caddy"}
2023/01/05 12:51:25.505 DEBUG tls.cache added certificate to cache {"subjects": ["crios.bris.fr"], "expiration": "2023/03/12 16:44:05.000", "managed": true, "issuer_key": "acme-v02.api.letsencrypt.org-directory", "hash": "a780dad0e16f4f95c1fa39d995aa6815e48cf68550b85e7243a08e3ad7293889", "cache_size": 1, "cache_capacity": 10000}
2023/01/05 12:51:25.509 DEBUG events event {"name": "cached_managed_cert", "id": "1e2bc15e-a2d4-446e-9fc6-e6fb992b3396", "origin": "tls", "data": {"sans":["crios.bris.fr"]}}
2023/01/05 12:51:25.483 INFO tls cleaning storage unit {"description": "FileStorage:/root/.local/share/caddy"}
2023/01/05 12:51:25.530 INFO autosaved config (load with --resume flag) {"file": "/root/.config/caddy/autosave.json"}
2023/01/05 12:51:25.533 INFO serving initial configuration
2023/01/05 12:51:25.540 INFO tls finished cleaning storage units
2023/01/05 12:51:31.472 DEBUG http.stdlib http: TLS handshake error from 192.168.9.1:54534: tls: first record does not look like a TLS handshake
Thanks for your reply!
I have to say that the Synology support has just answered that this service is not working with a reverse proxy, but should work directly:
After consulting with our specialists, I confirm that a reverse proxy rule would be applicable for Synology Drive web interface operation (or Synology Drive for Android), but it does not work for Synology Drive client synchronization (port 6690).
Even though I don’t understand why, so perhaps you should not spend too much time…
Regards
Pascal
PS: perhaps you know Win and Andoid sync open source software that work well with Caddy reverse-proxy and basic_auth…