diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2017-02-25 08:03:14 +0100 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2017-02-25 08:04:38 +0100 |
commit | 3a4dd97c550bf01bba09c00f36203e5ac105a07f (patch) | |
tree | ae3b2f5848915159145611ceaab46102a04f152d /nixos/modules | |
parent | e564a399d91e459982aa7b2076078bb9139e48a0 (diff) |
nginx module: fix acme if vhost name != serverName
cc #21931 @bobvanderlinden
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/web-servers/nginx/default.nix | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix index 9e93e56b9c2c..1150459d40e1 100644 --- a/nixos/modules/services/web-servers/nginx/default.nix +++ b/nixos/modules/services/web-servers/nginx/default.nix @@ -5,13 +5,16 @@ with lib; let cfg = config.services.nginx; virtualHosts = mapAttrs (vhostName: vhostConfig: - vhostConfig // { + let serverName = if vhostConfig.serverName != null then vhostConfig.serverName else vhostName; + in + vhostConfig // { + inherit serverName; } // (optionalAttrs vhostConfig.enableACME { - sslCertificate = "/var/lib/acme/${vhostName}/fullchain.pem"; - sslCertificateKey = "/var/lib/acme/${vhostName}/key.pem"; + sslCertificate = "/var/lib/acme/${serverName}/fullchain.pem"; + sslCertificateKey = "/var/lib/acme/${serverName}/key.pem"; }) ) cfg.virtualHosts; enableIPv6 = config.networking.enableIPv6; |