mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
feat(y2q): add caddy
- Add a runit service for Caddy with a Caddyfile - Update cloudflared runit service: - Add support for multiple subdomains using dynamic YAML generation - Each subdomain routes to Caddy running on localhost (port 8080)
This commit is contained in:
parent
431847b59f
commit
cee1c9bc5d
2 changed files with 41 additions and 5 deletions
32
home/modules/runit/services/caddy.nix
Normal file
32
home/modules/runit/services/caddy.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ pkgs, config, ... }:
|
||||
|
||||
{
|
||||
home.file.".config/caddy/Caddyfile".text = ''
|
||||
{
|
||||
http_port 8080
|
||||
https_port 8443
|
||||
auto_https off
|
||||
}
|
||||
|
||||
# Cloudflare Tunnel
|
||||
http://gist.toast.name {
|
||||
# Opengist
|
||||
reverse_proxy http://localhost:${config.runit.services.opengist.environment.OG_HTTP_PORT}
|
||||
}
|
||||
|
||||
# Tailscale
|
||||
http://y2q.ts.toast.name {
|
||||
# Glances
|
||||
reverse_proxy http://localhost:61208
|
||||
}
|
||||
'';
|
||||
|
||||
runit.services.caddy = {
|
||||
script = ''
|
||||
exec ${pkgs.caddy}/bin/caddy run \
|
||||
--config "$HOME/.config/caddy/Caddyfile" \
|
||||
--adapter caddyfile
|
||||
'';
|
||||
log.enable = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue