Do not set Host header when backend protocol is grpc

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-06-18 23:43:41 -04:00
parent 6140fdd31d
commit d7b213d979
No known key found for this signature in database
GPG key ID: 786136016A8BA02A

View file

@ -1173,11 +1173,13 @@ stream {
{{ end }} {{ end }}
{{/* By default use vhost as Host to upstream, but allow overrides */}} {{/* By default use vhost as Host to upstream, but allow overrides */}}
{{ if not (eq $proxySetHeader "grpc_set_header") }}
{{ if not (empty $location.UpstreamVhost) }} {{ if not (empty $location.UpstreamVhost) }}
{{ $proxySetHeader }} Host "{{ $location.UpstreamVhost }}"; {{ $proxySetHeader }} Host "{{ $location.UpstreamVhost }}";
{{ else }} {{ else }}
{{ $proxySetHeader }} Host $best_http_host; {{ $proxySetHeader }} Host $best_http_host;
{{ end }} {{ end }}
{{ end }}
# Pass the extracted client certificate to the backend # Pass the extracted client certificate to the backend
{{ if not (empty $server.CertificateAuth.CAFileName) }} {{ if not (empty $server.CertificateAuth.CAFileName) }}