4 ms·
Caddy can absolutely do both of those things. - https://caddyserver.com/docs/modules/http.reverse_proxy.upstreams.srv https://caddyserver.com/docs/modules/http
by mholt 2y ago
Caddy can absolutely do both of those things.
- https://caddyserver.com/docs/modules/http.reverse_proxy.upstreams.srv https://caddyserver.com/docs/modules/http.reverse_proxy.upst...
- https://github.com/mholt/caddy-l4 https://github.com/mholt/caddy-l4
- lmeyerov 2y agoWe are long-time fans of Caddy, preferring it over traefik + nginx especially for our docker-compose flows.. though it's fair to distinguish 'can' vs 'easy to do' E.g., we can imagine writing or using a plugin to figure out some upcoming fancy sticky session routing logic based on routes/content vs just the user IP, but there are easier and more 'with the grain' solutions than with what Caddy exposes today, afaict (Agreed tho: The reverse proxy module, for more typical cases, is awesome and we have been enjoying for years!)
- francislavoie 2y agoSticky sessions are supported: https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#load-balancing https://caddyserver.com/docs/caddyfile/directives/reverse_pr..., and yes it's pluggable so you could write your own LB policy. Very easy, just copy the code from Caddy's source to write your own plugin. Let us know if you need help. Also yes, Caddy does service discovery if you use https://github.com/lucaslorentz/caddy-docker-proxy https://github.com/lucaslorentz/caddy-docker-proxy, configuration via Docker labels. Or you can use dynamic upstreams (built-in) https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#dynamic-upstreams https://caddyserver.com/docs/caddyfile/directives/reverse_pr... to use A/AAAA or SRV DNS records to load your list of upstreams.
- lmeyerov 2y ago`query [key] ` A+++, I missed when this got added, amazing! (this basically solves the sticky shared chatroom websocket problem for us when routing to resources with gravity, in our case, multiuser data science notebooks!)
- jiehong 2y agocaddy-l4 still shows: This app is very capable and flexible, but is still in development. Please expect breaking changes. And it does not seem to be really seeing many new commits recently, so it feels pretty much "beta" at this point.