1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-02-24 09:48:14 +00:00

fix: Use parseBool to parse boolean strings

This commit is contained in:
Richard Hansen 2022-03-28 01:04:20 -04:00
parent c117ae8fd8
commit 05423c681a

View File

@ -92,7 +92,7 @@
upstream {{ .Upstream }} {
{{ $server_found := false }}
{{ range $container := .Containers }}
{{ $debug := (eq (coalesce $container.Env.DEBUG $debug_all "false") "true") }}
{{ $debug := parseBool (coalesce $container.Env.DEBUG $debug_all "false") }}
{{/* If only 1 port exposed, use that as a default, else 80 */}}
{{ $defaultPort := (when (eq (len $container.Addresses) 1) (first $container.Addresses) (dict "Port" "80")).Port }}
{{ $port := (coalesce $container.Env.VIRTUAL_PORT $defaultPort) }}
@ -229,7 +229,7 @@ proxy_set_header Proxy "";
{{ $access_log := (or (and (not $.Env.DISABLE_ACCESS_LOGS) "access_log /var/log/nginx/access.log vhost;") "") }}
{{ $enable_ipv6 := eq (or ($.Env.ENABLE_IPV6) "") "true" }}
{{ $enable_ipv6 := parseBool (coalesce $.Env.ENABLE_IPV6 "false") }}
server {
server_name _; # This is just an invalid value which will never trigger on a real hostname.
server_tokens off;