mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-27 14:34:33 +00:00
fix: nixos/nginx certificate location
Fix issue when using a cert location other than the default.
This commit is contained in:
parent
ee28e35ba3
commit
8614e22297
@ -9,15 +9,16 @@ let
|
|||||||
serverName = if vhostConfig.serverName != null
|
serverName = if vhostConfig.serverName != null
|
||||||
then vhostConfig.serverName
|
then vhostConfig.serverName
|
||||||
else vhostName;
|
else vhostName;
|
||||||
|
acmeDirectory = config.security.acme.directory;
|
||||||
in
|
in
|
||||||
vhostConfig // {
|
vhostConfig // {
|
||||||
inherit serverName;
|
inherit serverName;
|
||||||
} // (optionalAttrs vhostConfig.enableACME {
|
} // (optionalAttrs vhostConfig.enableACME {
|
||||||
sslCertificate = "/var/lib/acme/${serverName}/fullchain.pem";
|
sslCertificate = "${acmeDirectory}/${serverName}/fullchain.pem";
|
||||||
sslCertificateKey = "/var/lib/acme/${serverName}/key.pem";
|
sslCertificateKey = "${acmeDirectory}/${serverName}/key.pem";
|
||||||
}) // (optionalAttrs (vhostConfig.useACMEHost != null) {
|
}) // (optionalAttrs (vhostConfig.useACMEHost != null) {
|
||||||
sslCertificate = "/var/lib/acme/${vhostConfig.useACMEHost}/fullchain.pem";
|
sslCertificate = "${acmeDirectory}/${vhostConfig.useACMEHost}/fullchain.pem";
|
||||||
sslCertificateKey = "/var/lib/acme/${vhostConfig.useACMEHost}/key.pem";
|
sslCertificateKey = "${acmeDirectory}/${vhostConfig.useACMEHost}/key.pem";
|
||||||
})
|
})
|
||||||
) cfg.virtualHosts;
|
) cfg.virtualHosts;
|
||||||
enableIPv6 = config.networking.enableIPv6;
|
enableIPv6 = config.networking.enableIPv6;
|
||||||
|
Loading…
Reference in New Issue
Block a user