fix: constistent behavior for HTTPS_METHOD=nohttp

Without this fix the response of nohttp sites to HTTP requests changes
depending on the existence of at least one HTTP enabled site:
* no HTTP enabled sites -> connection refused
* at least one HTTP enabled site -> 503

This fix ensures the response is always 503.
This commit is contained in:
Gilles Filippini committed 2024-05-14 22:37:32 +02:00
1 parent 2564a93966
commit 91652aac48
3 files changed
+10 -13

No files matched your search

+1 -2
View File
@@ -650,7 +650,7 @@ proxy_set_header Proxy "";
{{- $default_https_exists = or $default_https_exists (and $https $vhost.default) }}
{{- $http3_enabled = or $http3_enabled $vhost.http3_enabled }}
{{- end }}
{{- $fallback_http := and $http_exists (not $default_http_exists) }}
{{- $fallback_http := not $default_http_exists }}
{{- $fallback_https := and $https_exists (not $default_https_exists) }}
{{- /*
* If there are no vhosts at all, create fallbacks for both plain http
@@ -658,7 +658,6 @@ proxy_set_header Proxy "";
* refused error.
*/}}
{{- if and (not $http_exists) (not $https_exists) }}
{{- $fallback_http = true }}
{{- $fallback_https = true }}
{{- end }}
{{- if or $fallback_http $fallback_https }}