From 86c5649e74a6b4b6fa864b1c509b9fc3ddf7c6e3 Mon Sep 17 00:00:00 2001 From: MDLeom <2809763-curben@users.noreply.gitlab.com> Date: Sun, 30 Aug 2020 09:23:35 +0000 Subject: [PATCH] post(caddy-2): must use "caddy reload" to reload config - https://github.com/caddyserver/dist/blob/ce8860dbfe32fab755b5f87e4f06373c0c849d13/init/caddy.service#L25 --- source/_posts/caddy-v2-nixos.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/_posts/caddy-v2-nixos.md b/source/_posts/caddy-v2-nixos.md index 51d7a25..d37f449 100644 --- a/source/_posts/caddy-v2-nixos.md +++ b/source/_posts/caddy-v2-nixos.md @@ -2,6 +2,7 @@ title: Running Caddy 2 in NixOS 20.03 excerpt: Use stable v2 instead of beta release date: 2020-05-24 +updated: 2020-08-30 tags: - server - caddy @@ -84,6 +85,11 @@ in { '' else '' ${cfg.package}/bin/caddy -root=/var/tmp -conf=${cfg.config} ''; + ExecReload = if isCaddy2 then '' + ${cfg.package}/bin/caddy reload --config ${cfg.config} --adapter ${cfg.adapter} + '' else '' + "${pkgs.coreutils}/bin/kill -HUP $MAINPID" + ''; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; Type = "simple"; User = "caddy";