*.edholm.cc { # Options import /usr/local/etc/caddy/caddy.d/*.conf # Or perhaps lookup files with the configured domain as a prefix, like *.edholm.cc.conf}
ha.example.us. 1 IN A <my WAN IP>plex.example.us. 1 IN A <my WAN IP>*.example.us. 1 IN A <my WAN IP>example.us. 1 IN A <my WAN IP>router.example.us. 1 IN A <my WAN IP>sonarr.example.us. 1 IN A <my WAN IP>
Protocol: https://domain: *.example.usCert: ACMEDNS-01 Challenge: checkedDynamic DNS: unchecked
Domain: *.example.usSubdomain: plex.example.usDynamic DNS: checked
Domain: *.example.usSubdomain: plex.example.usdirective: reverse_proxyProtocol: Https://Upstream Domain: plex server's local IPUpstream Port: 32400TLS Insecure Skip Verify: checked
# DO NOT EDIT THIS FILE -- OPNsense auto-generated file# caddy_user=root# Global Options{ log { output net unixgram//var/run/caddy/log.sock { } format json { time_format rfc3339 } } servers { protocols h1 h2 h3 } dynamic_dns { provider cloudflare <my token> domains { example.us plex example.us router example.us sonarr example.us ha } } email myemail@gmail.com grace_period 10s import /usr/local/etc/caddy/caddy.d/*.global}# Reverse Proxy Configuration# Reverse Proxy Domain: "14b010dd-6f6d-4ba8-94df-898d341059b8"*.example.us { tls { issuer acme { dns cloudflare <my token> } } @85082da4-6d7a-410d-9955-d9c114e40692 { host plex.example.us } handle @85082da4-6d7a-410d-9955-d9c114e40692 { handle { reverse_proxy 192.168.1.137:32400 { transport http { tls tls_insecure_skip_verify } } } } @fc7226be-505c-4b24-b95b-e01cb5e11a32 { host router.example.us } handle @fc7226be-505c-4b24-b95b-e01cb5e11a32 { handle { reverse_proxy 192.168.1.1:8443 { } } } @e857ccbe-2f6a-4d4d-86f5-f8a5ab908e70 { host sonarr.example.us } handle @e857ccbe-2f6a-4d4d-86f5-f8a5ab908e70 { handle { reverse_proxy 192.168.1.137:8989 { transport http { tls tls_insecure_skip_verify } } } } @fa0581ec-66ca-4526-ae6b-6a059d16f73c { host ha.example.us } handle @fa0581ec-66ca-4526-ae6b-6a059d16f73c { handle { reverse_proxy 192.168.1.138:8123 { } } }}import /usr/local/etc/caddy/caddy.d/*.conf
Hi,I install Caddy and configure follow the tutorial but I have error:"error","ts":"2024-10-11T07:26:56Z","logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"toto.pequod.sokil.fr","issuer":"acme-v02.api.letsencrypt.org-directory","error":"HTTP 400 urn:ietf:params:acme:error:connection - 89.219.181.98: Timeout during connect (likely firewall problem)"}I really don't know where to startI also on freeBSD and debian install caddy to test with the same error.I have another site with OPNsense and caddy on debian behind without error, I miss something but what ?
I think you have to configure "trusted proxies" to a list of cloudflare IPs in General Settings. (if you use it as CDN and not only as DNS provider)There can also be cloudflare specific settings to be done at cloudflare itself I do not know about. I dont use it sorry. I think Cloudflare can itself be tje reverse proxy entry point for domains configured on it.Check out whatcurl -v example.comreturns from the outside.
* Host sonarr.mydomain.us:80 was resolved.* IPv6: (none)* IPv4: <mywanip>* Trying <mywanip>:80...* Connected to sonarr.mydomain.us (<mywanip>) port 80> GET / HTTP/1.1> Host: sonarr.mydomain.us> User-Agent: curl/8.9.1> Accept: */*>< HTTP/1.1 308 Permanent Redirect< Connection: close< Location: https://sonarr.mydomain.us/< Server: Caddy< Date: Mon, 04 Nov 2024 17:52:26 GMT< Content-Length: 0<* we are done reading and this is set to close, stop send* shutting down connection #0
* Host sonarr.mydomain.us:80 was resolved.* IPv6: (none)* IPv4: <wanip>* Trying <wanip>:80...* Connected to sonarr.mydomain.us (<wanip>) port 80> GET / HTTP/1.1> Host: sonarr.mydomain.us> User-Agent: curl/8.9.1> Accept: */*>* Request completely sent off< HTTP/1.1 308 Permanent Redirect< Connection: close< Location: https://sonarr.mydomain.us/< Server: Caddy< Date: Mon, 04 Nov 2024 19:32:57 GMT< Content-Length: 0<* shutting down connection #0
curl -v sonarr.example.us:443* Host sonarr.example.us:443 was resolved.* IPv6: (none)* IPv4: <wanip>* Trying <wanip>:443...* Connected to sonarr.example.us (<wanip>) port 443> GET / HTTP/1.1> Host: sonarr.example.us:443> User-Agent: curl/8.9.1> Accept: */*>* Request completely sent off* HTTP 1.0, assume close after body< HTTP/1.0 400 Bad Request<Client sent an HTTP request to an HTTPS server.* shutting down connection #0
C:\Users\me>curl -v mydomain.us* Host mydomain.us:80 was resolved.* IPv6: (none)* IPv4: <wanIP>* Trying <wanIP>:80...* Connected to mydomain.us (<wanIP>) port 80> GET / HTTP/1.1> Host: mydomain.us> User-Agent: curl/8.9.1> Accept: */*>< HTTP/1.1 308 Permanent Redirect< Connection: close< Location: https://mydomain.us/< Server: Caddy< Date: Mon, 04 Nov 2024 21:16:01 GMT< Content-Length: 0<* we are done reading and this is set to close, stop send* shutting down connection #0
C:\Users\me>curl -v https://mydomain.us* Host mydomain.us:443 was resolved.* IPv6: (none)* IPv4: <wanIP>* Trying <wanIP>:443...* Connected to mydomain.us (<wanIP>) port 443* schannel: disabled automatic use of client certificate* ALPN: curl offers http/1.1* schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed). More detail may be available in the Windows System event log.* closing connection #0curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed). More detail may be available in the Windows System event log.
C:\Users\me>curl -v https://www.mydomain.us* Host www.mydomain.us:443 was resolved.* IPv6: (none)* IPv4: <wanIP>* Trying <wanIP>:443...* Connected to www.mydomain.us (<wanIP>) port 443* schannel: disabled automatic use of client certificate* ALPN: curl offers http/1.1* ALPN: server accepted http/1.1* using HTTP/1.x> GET / HTTP/1.1> Host: www.mydomain.us> User-Agent: curl/8.9.1> Accept: */*>* schannel: remote party requests renegotiation* schannel: renegotiating SSL/TLS connection* schannel: SSL/TLS connection renegotiated< HTTP/1.1 200 OK< Alt-Svc: h3=":443"; ma=2592000< Server: Caddy< Date: Mon, 04 Nov 2024 21:19:35 GMT< Content-Length: 0<* Connection #0 to host www.mydomain.us left intact