1. The problem I’m having:
I need to config Caddy to work with my Livekit Server. I set up follow Livekit Docs but I stuck on configuring caddy.yaml. I have had own SSL Certs, but I found post below (I put in relevant resources) so I try to use ZeroSSL, it seems not work with error logs below.
In my server I have already used nginx for other processes. So does it make any conflicts?
Thank you!
2. Error messages and/or full log output:
{"level":"info","ts":1717155753.157638,"msg":"using provided configuration","config_file":"/etc/caddy.yaml","config_adapter":"yaml"}
{"level":"info","ts":1717155753.1610882,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"info","ts":1717155753.1618733,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00049a850"}
{"level":"info","ts":1717155753.1632066,"msg":"autosaved config (load with --resume flag)","file":"/root/.config/caddy/autosave.json"}
{"level":"info","ts":1717155753.1632266,"msg":"serving initial configuration"}
{"level":"info","ts":1717155753.1632597,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data"}
{"level":"info","ts":1717155753.1634846,"logger":"tls","msg":"finished cleaning storage units"}
{"level":"info","ts":1717155753.1640186,"logger":"tls.obtain","msg":"acquiring lock","identifier":"video.pancake.vn"}
{"level":"info","ts":1717155753.1647782,"logger":"tls.obtain","msg":"acquiring lock","identifier":"turnchat.pancake.vn"}
{"level":"info","ts":1717155753.1721122,"logger":"tls.obtain","msg":"lock acquired","identifier":"turnchat.pancake.vn"}
{"level":"info","ts":1717155753.172173,"logger":"tls.obtain","msg":"lock acquired","identifier":"video.pancake.vn"}
{"level":"info","ts":1717155753.172842,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"turnchat.pancake.vn"}
{"level":"info","ts":1717155753.1730306,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"video.pancake.vn"}
{"level":"info","ts":1717155753.1761513,"logger":"tls.issuance.zerossl","msg":"waiting on internal rate limiter","identifiers":["video.pancake.vn"],"ca":"https://acme.zerossl.com/v2/DV90","account":""}
{"level":"info","ts":1717155753.1763527,"logger":"tls.issuance.zerossl","msg":"done waiting on internal rate limiter","identifiers":["video.pancake.vn"],"ca":"https://acme.zerossl.com/v2/DV90","account":""}
{"level":"info","ts":1717155753.179512,"logger":"tls.issuance.zerossl","msg":"waiting on internal rate limiter","identifiers":["turnchat.pancake.vn"],"ca":"https://acme.zerossl.com/v2/DV90","account":""}
{"level":"info","ts":1717155753.179562,"logger":"tls.issuance.zerossl","msg":"done waiting on internal rate limiter","identifiers":["turnchat.pancake.vn"],"ca":"https://acme.zerossl.com/v2/DV90","account":""}
{"level":"info","ts":1717155755.696537,"logger":"tls.issuance.zerossl.acme_client","msg":"trying to solve challenge","identifier":"video.pancake.vn","challenge_type":"http-01","ca":"https://acme.zerossl.com/v2/DV90"}
{"level":"info","ts":1717155755.713596,"logger":"tls.issuance.zerossl.acme_client","msg":"trying to solve challenge","identifier":"turnchat.pancake.vn","challenge_type":"http-01","ca":"https://acme.zerossl.com/v2/DV90"}
3. Caddy version:
Caddy v2.6.2
4. How I installed and ran Caddy:
I run Caddy through Docker Image: https://hub.docker.com/r/livekit/caddyl4/tags
a. System environment:
Ubuntu 20.04.3
b. Command:
command: run --config /etc/caddy.yaml --adapter yaml
c. Service/unit/compose file:
version: "3.9"
services:
caddy:
image: livekit/caddyl4
command: run --config /etc/caddy.yaml --adapter yaml
restart: unless-stopped
network_mode: "host"
volumes:
- ./caddy.yaml:/etc/caddy.yaml
- ./caddy_data:/data
livekit:
image: livekit/livekit-server:latest
command: --config /etc/livekit.yaml
restart: unless-stopped
network_mode: "host"
volumes:
- ./livekit.yaml:/etc/livekit.yaml
redis:
image: redis:6-alpine
command: redis-server /etc/redis.conf
network_mode: "host"
volumes:
- ./redis.conf:/etc/redis.conf
d. My complete Caddy config:
logging:
logs:
default:
level: INFO
storage:
"module": "file_system"
"root": "/data"
apps:
tls:
certificates:
automate:
- video.pancake.vn
- turnchat.pancake.vn
automation:
policies:
- issuers:
- module: zerossl
api_key: my_api_key_from_zerossl
layer4:
servers:
main:
listen: [":4433"]
routes:
- match:
- tls:
sni:
- "turnchat.pancake.vn"
handle:
- handler: tls
- handler: proxy
upstreams:
- dial: ["10.1.13.40:5349"]
- match:
- tls:
sni:
- "video.pancake.vn"
handle:
- handler: tls
connection_policies:
- alpn: ["http/1.1"]
- handler: proxy
upstreams:
- dial: ["localhost:7880"]