nginx module: fix acme if vhost name != serverName
cc #21931 @bobvanderlinden
This commit is contained in:
parent
e564a399d9
commit
3a4dd97c55
1 changed files with 6 additions and 3 deletions
|
@ -5,13 +5,16 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.nginx;
|
cfg = config.services.nginx;
|
||||||
virtualHosts = mapAttrs (vhostName: vhostConfig:
|
virtualHosts = mapAttrs (vhostName: vhostConfig:
|
||||||
vhostConfig // {
|
let
|
||||||
serverName = if vhostConfig.serverName != null
|
serverName = if vhostConfig.serverName != null
|
||||||
then vhostConfig.serverName
|
then vhostConfig.serverName
|
||||||
else vhostName;
|
else vhostName;
|
||||||
|
in
|
||||||
|
vhostConfig // {
|
||||||
|
inherit serverName;
|
||||||
} // (optionalAttrs vhostConfig.enableACME {
|
} // (optionalAttrs vhostConfig.enableACME {
|
||||||
sslCertificate = "/var/lib/acme/${vhostName}/fullchain.pem";
|
sslCertificate = "/var/lib/acme/${serverName}/fullchain.pem";
|
||||||
sslCertificateKey = "/var/lib/acme/${vhostName}/key.pem";
|
sslCertificateKey = "/var/lib/acme/${serverName}/key.pem";
|
||||||
})
|
})
|
||||||
) cfg.virtualHosts;
|
) cfg.virtualHosts;
|
||||||
enableIPv6 = config.networking.enableIPv6;
|
enableIPv6 = config.networking.enableIPv6;
|
||||||
|
|
Loading…
Reference in a new issue