From 4a6cf5e8b6ae6a35fce7b9b045c0c142cf9515e1 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Thu, 29 Sep 2016 12:02:45 -0300 Subject: [PATCH] Initialize proxy_upstream_name variable --- ingress/controllers/nginx/nginx.tmpl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ingress/controllers/nginx/nginx.tmpl b/ingress/controllers/nginx/nginx.tmpl index c4e5676171..18548282ce 100644 --- a/ingress/controllers/nginx/nginx.tmpl +++ b/ingress/controllers/nginx/nginx.tmpl @@ -41,7 +41,7 @@ http { # lua section to return proper error codes when custom pages are used lua_package_path '.?.lua;./etc/nginx/lua/?.lua;/etc/nginx/lua/vendor/lua-resty-http/lib/?.lua;'; - init_by_lua_block { + init_by_lua_block { require("error_page") } @@ -185,7 +185,7 @@ http { listen 80{{ if $cfg.useProxyProtocol }} proxy_protocol{{ end }}; {{ if $server.SSL }}listen 443 {{ if $cfg.useProxyProtocol }}proxy_protocol{{ end }} ssl {{ if $cfg.enableSpdy }}spdy{{ end }} {{ if $cfg.useHttp2 }}http2{{ end }}; {{/* comment PEM sha is required to detect changes in the generated configuration and force a reload */}} - # PEM sha: {{ $server.SSLPemChecksum }} + # PEM sha: {{ $server.SSLPemChecksum }} ssl_certificate {{ $server.SSLCertificate }}; ssl_certificate_key {{ $server.SSLCertificateKey }}; {{- end }} @@ -314,6 +314,7 @@ http { } location / { + set $proxy_upstream_name "upstream-default-backend"; proxy_pass http://upstream-default-backend; } {{- template "CUSTOM_ERRORS" $cfg }} @@ -322,6 +323,7 @@ http { # default server for services without endpoints server { listen 8181; + set $proxy_upstream_name "-"; location / { {{ if .customErrors }} @@ -331,7 +333,7 @@ http { {{ else }} return 503; {{ end }} - } + } } }