Skip to content

Commit 5665b87

Browse files
Add HTTP to HTTPS redirect in nginx gateway (#24)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent efda877 commit 5665b87

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

chart/templates/configmap-nginx.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ data:
2020
client_body_buffer_size 128k;
2121
client_header_buffer_size 1k;
2222
large_client_header_buffers 4 16k;
23+
24+
{{- if include "openops.isHttps" . }}
25+
# Redirect HTTP to HTTPS when behind a TLS-terminating load balancer
26+
if ($http_x_forwarded_proto = "http") {
27+
return 301 https://$host$request_uri;
28+
}
29+
{{- end }}
2330
2431
# Security headers
2532
{{- if .Values.nginx.securityHeaders.enabled }}

0 commit comments

Comments
 (0)