Skip to content

Commit

Permalink
Allow for adding more addresses for caddy server
Browse files Browse the repository at this point in the history
...by adding the caddyServerAliases option to nix module.
  • Loading branch information
otargowski committed Jul 11, 2024
1 parent 6922280 commit ff8bf3d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nix/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ in
'';
};

caddyServerAliases = lib.mkOption {
default = [];
type = lib.types.listOf lib.types.str;
description = lib.mkDoc ''
Additional domains or IPs for caddy to respond at.
'';
};

useCaddy = lib.mkOption {
default = true;
description = lib.mdDoc ''
Expand Down Expand Up @@ -327,6 +335,7 @@ in
enable = true;
inherit logFormat;
virtualHosts."${cfg.domain}${lib.optionalString (!cfg.useSSL) ":80"}" = {
serverAliases = cfg.caddyServerAliases;
logFormat = logFormat + ''
output file /var/log/caddy/access-${cfg.domain}.log
'';
Expand Down

0 comments on commit ff8bf3d

Please sign in to comment.