I want to run caddy in front of a code-server with a TLS frontend.
a. System environment:
Ubuntu 21.10
b. Command:
Using systemd
c. Service/unit/compose file:
N/A
d. My complete Caddyfile or JSON config:
code.chrisshort.net {
uri strip_prefix /code
reverse_proxy 127.0.0.1:3000
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
protocols tls1.2 tls1.3
}
}
3. The problem I’m having:
I had an ssl error and got that fixed. Now I get a timeout. Port 443 on my EdgeRouter forwards to this system’s IP address. I’m really not sure what’s going wrong.
Remove this, it’s redundant. Caddy default to TLS 1.2 as minimum and the maximum that exists currently is TLS 1.3. Having this in your config would prevent a future version of Caddy from being able to automatically enable some theoretical TLS 1.4 if/when that is introduced. Let Caddy do the smart thing.
Are you sure you need this? You already have a code subdomain.
You made a request to localhost but you configured your domain as code.chrisshort.net. Make a request to code.chrisshort.net instead and it should work. You didn’t configure Caddy to serve a certificate for localhost.
Turns out the firewall configuration on my EdgeRouter didn’t take. Traffic to 443 wasn’t being passed to the server. Now it is and everything is working wonderfully.