50 ms·
Caddy is absolutely amazing. I'm running it on an RPi that's hosting various home automation and hobby projects, all serving HTTP to the loopback interface onl
by lxgr 5y ago
Caddy is absolutely amazing.
I'm running it on an RPi that's hosting various home automation and hobby projects, all serving HTTP to the loopback interface only, with Caddy acting as a reverse proxy, and I've never even had to think about HTTPS. Adding a new service is adding a single line to my config file, and the rest happens automatically.
Finally, no more "trust this self-signed certificate" even for toy projects, no more port forwarding, copy-paste-ing dubious PEM and CRT files across services and Docker containers etc.
- simonw 5y agoWould you mind sharing a (redacted if you like) copy of your config file in a Gist? Purely out of curiosity - your setup sounds really neat.
- lxgr 5y agoSure, here's a redacted example: https://gist.github.com/lxgr/303b1a3cd87005edb43b91545c5306ba https://gist.github.com/lxgr/303b1a3cd87005edb43b91545c5306b... I unfortunately can't remember if there is some header/footer I'm omitting here – this file is managed by Ansible for my setup, but I believe it should effectively be the full Caddyfile.
- simonw 5y agoThat's really useful, thanks!
- m-p-3 5y agoI'm definitely going to put Caddy on my next NAS build, sounds like a delightful proxy to setup.
- okasaki 5y agoSetting that up with nginx and acme.sh is pretty easy as well. One benefit I found with using nginx is that services are more likely to have nginx proxy example configs, and sometimes these are non-trivial, eg.: https://docs.mattermost.com/install/config-proxy-nginx.html https://docs.mattermost.com/install/config-proxy-nginx.html I guess with caddy you're on your own, which doesn't look like fun.
- francislavoie 5y agoCaddy's defaults usually mean your config ends up being 1/4 or less of the size of Nginx ultimately. Often the 'reverse_proxy' directive's defaults are good enough, if the app you're proxying to is reasonably modern. But if you need help, we're very active on https://caddy.community/ https://caddy.community/ to answer questions :)
- mindwok 5y agoCheck out the config adapters: https://caddyserver.com/docs/config-adapters https://caddyserver.com/docs/config-adapters Now you can use your nginx config with Caddy!
- nyolfen 5y agohere is my example config for a caddy reverse proxy with automatic tls: sub.domain.com { reverse_proxy localhost:8080 }