Caddy Setup
Caddy handles SSL termination and reverse proxy routing for Lygotype. SSL certificates are issued automatically via Let's Encrypt — no manual configuration needed.
Prerequisites
- Caddy installed and running in Docker (recommended) or natively
- DNS A record pointing
lygo.yourdomain.comto your VPS IP - Lygotype container running on the
webDocker network
Caddyfile block
Add this to your Caddyfile:
``caddy
lygo.yourdomain.com {
reverse_proxy lygotype-app:3001
}
`
For www redirect:
`caddy
www.yourdomain.com {
redir https://yourdomain.com{uri} permanent
}
`
Full example with multiple services
`caddy
lygo.yourdomain.com {
reverse_proxy lygotype-app:3001
}
lygotype.ca, www.lygotype.ca {
redir www.lygotype.ca https://lygotype.ca{uri} permanent
reverse_proxy lygotype-site:3000
}
`
Reloading Caddy
After editing the Caddyfile:
`bash
If Caddy is running in Docker
docker exec caddy caddy reload --config /etc/caddy/Caddyfile
If Caddy is running natively
caddy reload `Checking SSL
After DNS propagates (usually 1–5 minutes):
`bash
curl -I https://lygo.yourdomain.com
Should return HTTP/2 200
`Caddy automatically renews certificates before expiry. No manual renewal required.
Troubleshooting
SSL cert not issuing:
- Confirm DNS A record points to the correct IP
- Confirm port 80 and 443 are open in your firewall
- Check Caddy logs:
docker logs caddy
502 Bad Gateway:
- Confirm the Lygotype container is running:
docker ps`