From 900b311a386b82ab66f209c1b9d4c292af08d6dc Mon Sep 17 00:00:00 2001 From: Tristan Helmich Date: Tue, 26 Jan 2016 14:29:30 +0100 Subject: [PATCH] nginx module: Fix ACME extraDomains, fix challenge url to not redirect to allow renewals --- nixos/modules/services/web-servers/nginx/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix index a84a3c9f2a2..fb3f554bbf2 100644 --- a/nixos/modules/services/web-servers/nginx/default.nix +++ b/nixos/modules/services/web-servers/nginx/default.nix @@ -85,7 +85,9 @@ let server_name ${serverName} ${concatStringsSep " " vhost.serverAliases}; ${optionalString vhost.enableACME "location /.well-known/acme-challenge { root ${vhost.acmeRoot}; }"} - return 301 https://$host${optionalString (port != 443) ":${port}"}$request_uri; + location / { + return 301 https://$host${optionalString (port != 443) ":${port}"}$request_uri; + } } ''} @@ -227,9 +229,7 @@ in security.acme.certs = mapAttrs (vhostName: vhostConfig: { webroot = vhostConfig.acmeRoot; - extraDomains = genAttrs vhostConfig.serverAliases (alias: { - "${alias}" = null; - }); + extraDomains = genAttrs vhostConfig.serverAliases (alias: null); }) virtualHosts;