3
0
Fork 0
forked from mirrors/nixpkgs

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
This commit is contained in:
IndeedNotJames 2023-06-05 17:59:10 +02:00 committed by emilylange
parent 3f93ec5814
commit 93b9fc8ac0
No known key found for this signature in database
GPG key ID: 0AD773CE46FD0F87

View file

@ -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}