nixos/nginx: skip adding a comment to acmeLocation in nginx configuration

This commit is contained in:
Izorkin 2023-12-24 09:43:34 +03:00
parent 7f1b6d45af
commit ae5c0c1521
No known key found for this signature in database
GPG key ID: 1436C1B3F3679F09

View file

@ -352,10 +352,11 @@ let
# The acme-challenge location doesn't need to be added if we are not using any automated # The acme-challenge location doesn't need to be added if we are not using any automated
# certificate provisioning and can also be omitted when we use a certificate obtained via a DNS-01 challenge # certificate provisioning and can also be omitted when we use a certificate obtained via a DNS-01 challenge
acmeLocation = optionalString (vhost.enableACME || (vhost.useACMEHost != null && config.security.acme.certs.${vhost.useACMEHost}.dnsProvider == null)) '' acmeLocation = optionalString (vhost.enableACME || (vhost.useACMEHost != null && config.security.acme.certs.${vhost.useACMEHost}.dnsProvider == null))
# Rule for legitimate ACME Challenge requests (like /.well-known/acme-challenge/xxxxxxxxx) # Rule for legitimate ACME Challenge requests (like /.well-known/acme-challenge/xxxxxxxxx)
# We use ^~ here, so that we don't check any regexes (which could # We use ^~ here, so that we don't check any regexes (which could
# otherwise easily override this intended match accidentally). # otherwise easily override this intended match accidentally).
''
location ^~ /.well-known/acme-challenge/ { location ^~ /.well-known/acme-challenge/ {
${optionalString (vhost.acmeFallbackHost != null) "try_files $uri @acme-fallback;"} ${optionalString (vhost.acmeFallbackHost != null) "try_files $uri @acme-fallback;"}
${optionalString (vhost.acmeRoot != null) "root ${vhost.acmeRoot};"} ${optionalString (vhost.acmeRoot != null) "root ${vhost.acmeRoot};"}