Fix redirects of backends with port other than 80

This commit is contained in:
Joao Morais 2017-01-24 09:44:26 -02:00
parent 74512c1276
commit 91e150ebf4

View file

@ -214,6 +214,10 @@ http {
more_set_headers "Strict-Transport-Security: max-age={{ $cfg.HSTSMaxAge }}{{ if $cfg.HSTSIncludeSubdomains }}; includeSubDomains{{ end }}; preload";
{{ end }}
{{ if not (eq $server.Hostname "_") }}
proxy_redirect ~https?://{{ $server.Hostname }}:?[0-9]*/(.*) /$1;
{{ end }}
{{ if $cfg.EnableVtsStatus }}vhost_traffic_status_filter_by_set_key $geoip_country_code country::$server_name;{{ end }}
{{ range $location := $server.Locations }}
@ -308,7 +312,6 @@ http {
proxy_send_timeout {{ $location.Proxy.SendTimeout }}s;
proxy_read_timeout {{ $location.Proxy.ReadTimeout }}s;
proxy_redirect off;
proxy_buffering off;
proxy_buffer_size "{{ $location.Proxy.BufferSize }}";