4 ms·
Is Caddy scriptable? I don't know much about it. But ever since I discovered nginx-lua-module and OpenResty it's been pretty much a game-changer for me. Curi
by VWWHFSfQ 5y ago
Is Caddy scriptable? I don't know much about it. But ever since I discovered nginx-lua-module and OpenResty it's been pretty much a game-changer for me. Curious if other popular webservers have done similar? Not really talking about things like mod_perl/php. Although I guess those are somewhat the same thing.
- mholt 5y agoKind of (indirectly); we don't have an interpreter built-in, but the JSON config is managed natively through an API: https://caddyserver.com/docs/api https://caddyserver.com/docs/api So yeah, you can write scripts that control Caddy while it's online. The nice thing about the API is you can code in whatever environment or language you prefer: no need to learn Caddy's scripting language or anything like that. (The config is JSON, so nearly every language can output it.)
- mhitza 5y agoApache has built-in lua scripting support nowadays.
- francislavoie 5y agoIt's also very easy to write plugins for Caddy: https://caddyserver.com/docs/extending-caddy https://caddyserver.com/docs/extending-caddy
- mholt 5y agoTrue, that's one reason we haven't prioritized scripting too. Writing a plugin that is natively compiled in is just as easy and can perform even better.