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}} {
11
11
12
12
{{range $server := .Servers}}
13
13
server {
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}}
15
17
{{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}}
17
21
ssl_certificate {{$server.SSLCertificate}};
18
22
ssl_certificate_key {{$server.SSLCertificateKey}};
19
23
{{end}}
@@ -35,7 +39,7 @@ server {
35
39
36
40
{{if $server.SSL}}
37
41
if ($scheme = http) {
38
- return 301 https://$host$request_uri;
42
+ return 301 https://$host:{{index $server.SSLPorts 0}} $request_uri;
39
43
}
40
44
{{- if $server.HSTS}}
41
45
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