|
2 | 2 |
|
3 | 3 | {{ $host_variable_name := coalesce $.Env.HOST_VARIABLE_NAME "VIRTUAL_HOST" }} |
4 | 4 | {{ $external_http_port := coalesce $.Env.HTTP_PORT "80" }} |
5 | | -{{ $external_https_port := coalesce $.Env.HTTPS_PASSTHROUGH_PORT $.Env.HTTPS_PORT "443" }} |
| 5 | +{{ $external_https_port := coalesce $.Env.HTTPS_PORT "443" }} |
| 6 | +{{ $listen_https_port := coalesce $.Env.HTTPS_PASSTHROUGH_PORT $external_https_port }} |
6 | 7 | {{ $https_passthrough_enabled := (ne (coalesce $.Env.HTTPS_PASSTHROUGH_PORT "") "") }} |
7 | 8 | {{ $http_proxy_protocol_enabled := (eq (coalesce $.Env.HTTP_PROXY_PROTOCOL "false") "true") }} |
8 | 9 | {{ $https_proxy_protocol_enabled := (or $https_passthrough_enabled (eq (coalesce $.Env.HTTPS_PROXY_PROTOCOL "false") "true")) }} |
@@ -147,9 +148,9 @@ server { |
147 | 148 | server { |
148 | 149 | server_name _; # This is just an invalid value which will never trigger on a real hostname. |
149 | 150 | server_tokens off; |
150 | | - listen {{ $external_https_port }} ssl http2 {{ $https_proxy_protocol }}; |
| 151 | + listen {{ $listen_https_port }} ssl http2 {{ $https_proxy_protocol }}; |
151 | 152 | {{ if $enable_ipv6 }} |
152 | | - listen [::]:{{ $external_https_port }} ssl http2 {{ $https_proxy_protocol }}; |
| 153 | + listen [::]:{{ $listen_https_port }} ssl http2 {{ $https_proxy_protocol }}; |
153 | 154 | {{ end }} |
154 | 155 | {{ if $https_proxy_protocol_enabled }} |
155 | 156 | {{ if $https_passthrough_enabled }} |
@@ -323,9 +324,9 @@ server { |
323 | 324 | {{ if $server_tokens }} |
324 | 325 | server_tokens {{ $server_tokens }}; |
325 | 326 | {{ end }} |
326 | | - listen {{ $external_https_port }} ssl http2 {{ $default_server }} {{ $https_proxy_protocol }}; |
| 327 | + listen {{ $listen_https_port }} ssl http2 {{ $default_server }} {{ $https_proxy_protocol }}; |
327 | 328 | {{ if $enable_ipv6 }} |
328 | | - listen [::]:{{ $external_https_port }} ssl http2 {{ $default_server }} {{ $https_proxy_protocol }}; |
| 329 | + listen [::]:{{ $listen_https_port }} ssl http2 {{ $default_server }} {{ $https_proxy_protocol }}; |
329 | 330 | {{ end }} |
330 | 331 | {{ if $https_proxy_protocol_enabled }} |
331 | 332 | {{ if $https_passthrough_enabled }} |
@@ -476,9 +477,9 @@ server { |
476 | 477 | {{ if $server_tokens }} |
477 | 478 | server_tokens {{ $server_tokens }}; |
478 | 479 | {{ end }} |
479 | | - listen {{ $external_https_port }} ssl http2 {{ $default_server }} {{ $https_proxy_protocol }}; |
| 480 | + listen {{ $listen_https_port }} ssl http2 {{ $default_server }} {{ $https_proxy_protocol }}; |
480 | 481 | {{ if $enable_ipv6 }} |
481 | | - listen [::]:{{ $external_https_port }} ssl http2 {{ $default_server }} {{ $https_proxy_protocol }}; |
| 482 | + listen [::]:{{ $listen_https_port }} ssl http2 {{ $default_server }} {{ $https_proxy_protocol }}; |
482 | 483 | {{ end }} |
483 | 484 | {{ if $https_proxy_protocol_enabled }} |
484 | 485 | {{ if $https_passthrough_enabled }} |
|
0 commit comments