about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorIndeedNotJames <git@indeednotjames.com>2023-06-05 17:59:10 +0200
committeremilylange <git@emilylange.de>2023-06-10 13:59:15 +0200
commit93b9fc8ac0ecf51c393ecafe73ba80277c700165 (patch)
tree31391996c6d42cd8da6465062d85462989e64c5a /nixos
parent3f93ec5814547ea75c709058dae0a14c17c98758 (diff)
downloadnixlib-93b9fc8ac0ecf51c393ecafe73ba80277c700165.tar
nixlib-93b9fc8ac0ecf51c393ecafe73ba80277c700165.tar.gz
nixlib-93b9fc8ac0ecf51c393ecafe73ba80277c700165.tar.bz2
nixlib-93b9fc8ac0ecf51c393ecafe73ba80277c700165.tar.lz
nixlib-93b9fc8ac0ecf51c393ecafe73ba80277c700165.tar.xz
nixlib-93b9fc8ac0ecf51c393ecafe73ba80277c700165.tar.zst
nixlib-93b9fc8ac0ecf51c393ecafe73ba80277c700165.zip
nixos/caddy: omit empty `bind` directive when `listenAddresses` is empty
context: https://caddy.community/t/random-502-errors-when-proxying-to-application-with-self-signed-certificate/19657/6
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/caddy/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/web-servers/caddy/default.nix b/nixos/modules/services/web-servers/caddy/default.nix
index b253a04150d7..70715a237250 100644
--- a/nixos/modules/services/web-servers/caddy/default.nix
+++ b/nixos/modules/services/web-servers/caddy/default.nix
@@ -14,7 +14,7 @@ let
     in
       ''
         ${hostOpts.hostName} ${concatStringsSep " " hostOpts.serverAliases} {
-          bind ${concatStringsSep " " hostOpts.listenAddresses}
+          ${optionalString (hostOpts.listenAddresses != [ ]) "bind ${concatStringsSep " " hostOpts.listenAddresses}"}
           ${optionalString (hostOpts.useACMEHost != null) "tls ${sslCertDir}/cert.pem ${sslCertDir}/key.pem"}
           log {
             ${hostOpts.logFormat}