Fix proxy_host variable configuration

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-12-24 12:32:56 -03:00
parent c3eeaca972
commit a73dac2c0b
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
2 changed files with 88 additions and 4 deletions

View file

@ -539,9 +539,6 @@ http {
{{ end }}
server_name {{ $hostname }};
{{/* default value of proxy_host is the name and port of a proxied server as specified in the proxy_pass directive */}}
set $proxy_host {{ $hostname }};
{{ if gt (len $cfg.BlockUserAgents) 0 }}
if ($block_ua) {
return 403;
@ -1126,7 +1123,8 @@ stream {
port_in_redirect {{ if $location.UsePortInRedirects }}on{{ else }}off{{ end }};
set $proxy_upstream_name "{{ buildUpstreamName $location }}";
set $proxy_upstream_name "{{ buildUpstreamName $location }}";
set $proxy_host $proxy_upstream_name;
{{/* redirect to HTTPS can be achieved forcing the redirect or having a SSL Certificate configured for the server */}}
{{ if (or $location.Rewrite.ForceSSLRedirect (and (not (empty $server.SSLCert.PemFileName)) $location.Rewrite.SSLRedirect)) }}