nginx service: use default_server parameter instead of default (#21371)

This commit is contained in:
tv 2016-12-23 11:52:44 +01:00 committed by Robin Gloster
parent d8478c7912
commit de44544ceb

View File

@ -117,7 +117,7 @@ let
ssl = vhost.enableSSL || vhost.forceSSL;
port = if vhost.port != null then vhost.port else (if ssl then 443 else 80);
listenString = toString port + optionalString ssl " ssl http2"
+ optionalString vhost.default " default";
+ optionalString vhost.default " default_server";
acmeLocation = optionalString vhost.enableACME (''
location /.well-known/acme-challenge {
${optionalString (vhost.acmeFallbackHost != null) "try_files $uri @acme-fallback;"}
@ -133,9 +133,9 @@ let
in ''
${optionalString vhost.forceSSL ''
server {
listen 80 ${optionalString vhost.default "default"};
listen 80 ${optionalString vhost.default "default_server"};
${optionalString enableIPv6
''listen [::]:80 ${optionalString vhost.default "default"};''
''listen [::]:80 ${optionalString vhost.default "default_server"};''
}
server_name ${serverName} ${concatStringsSep " " vhost.serverAliases};