File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
nginx-controller/nginx/templates Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,13 @@ upstream {{$upstream.Name}} {
1111
1212{{range $server := .Servers}}
1313server {
14- listen 80{{if $server.ProxyProtocol}} proxy_protocol{{end}};
14+ {{range $port := $server.Ports}}
15+ listen {{$port}}{{if $server.ProxyProtocol}} proxy_protocol{{end}};
16+ {{- end}}
1517 {{if $server.SSL}}
16- listen 443 ssl{{if $server.HTTP2}} http2{{end}}{{if $server.ProxyProtocol}} proxy_protocol{{end}};
18+ {{- range $port := $server.SSLPorts}}
19+ listen {{$port}} ssl{{if $server.HTTP2}} http2{{end}}{{if $server.ProxyProtocol}} proxy_protocol{{end}};
20+ {{- end}}
1721 ssl_certificate {{$server.SSLCertificate}};
1822 ssl_certificate_key {{$server.SSLCertificateKey}};
1923 {{end}}
@@ -35,7 +39,7 @@ server {
3539
3640 {{if $server.SSL}}
3741 if ($scheme = http) {
38- return 301 https://$host$request_uri;
42+ return 301 https://$host:{{index $server.SSLPorts 0}} $request_uri;
3943 }
4044 {{- if $server.HSTS}}
4145 add_header Strict-Transport-Security "max-age={{$server.HSTSMaxAge}}; {{if $server.HSTSIncludeSubdomains}}includeSubDomains; {{end}}preload" always;{{end}}
You can’t perform that action at this time.
0 commit comments