-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix HSTS header over non tls ingresses #481
Conversation
* Add HSTSBehindProxy annotation * Add HSTSBehindProxy configmap entry * Update ConfigMap/Annotations docs * Update OSS/Plus ingress templates * HSTS headers now added on redirects over https
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a bug. Otherwise looks good!
{{- if $server.RedirectToHTTPS}} | ||
if ($http_x_forwarded_proto = 'http') { | ||
return 301 https://$host$request_uri; | ||
} | ||
{{- end}} | ||
|
||
{{- if $server.SSLRedirect}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the SSL redirect part here must go into the following block
{{if $server.SSL}}
{{if not $server.GRPCOnly}}
<here, after hsts stuff>
{{end}}
{{end}}
Otherwise it is a BUG, because the redirect will be enabled for Ingress resources without any TLS termination.
Please double check that for an Ingress resource without TLS termination, no SSL redirect is generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for nginx oss template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice catch
nginx-controller binary was mistakenly added in #481 This PR removes the binary again
nginx-controller binary was mistakenly added in #481 This PR removes the binary again
Fixes: #404
Proposed changes
Checklist
Before creating a PR, run through this checklist and mark each as complete.