fix: nohttp(s) shouldn't disable fallback server

Say we have two containers:
- `app1` with `HTTPS_METHOD=redirect`
- `app2` with `HTTPS_METHOD=nohttps`

Without this change the fallback answer on an HTTPS request to an unknown
server would change depending on whether `app1` is up (503) or not
(connection refused). This is not wanted.

In case someone doesn't want HTTPS at all, they just have to not bind
port 443.
This commit is contained in:
Gilles Filippini committed 2024-06-06 22:04:15 +02:00
1 parent 50608d7826
commit 4606b15309
2 files changed
+5 -6

No files matched your search

+1 -1
View File
@@ -664,7 +664,7 @@ proxy_set_header Proxy "";
{{- $http3_enabled = or $http3_enabled $vhost.http3_enabled }}
{{- end }}
{{- $fallback_http := not $default_http_exists }}
{{- $fallback_https := and $https_exists (not $default_https_exists) }}
{{- $fallback_https := not $default_https_exists }}
{{- /*
* If there are no vhosts at all, create fallbacks for both plain http
* and https so that clients get something more useful than a connection