-
Notifications
You must be signed in to change notification settings - Fork 0
Add HTTP to HTTPS redirect in nginx gateway #24
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,13 @@ data: | |||||
| client_body_buffer_size 128k; | ||||||
| client_header_buffer_size 1k; | ||||||
| large_client_header_buffers 4 16k; | ||||||
|
|
||||||
| {{- if include "openops.isHttps" . }} | ||||||
| # Redirect HTTP to HTTPS when behind a TLS-terminating load balancer | ||||||
| if ($http_x_forwarded_proto = "http") { | ||||||
| return 301 https://$host$request_uri; | ||||||
|
||||||
| return 301 https://$host$request_uri; | |
| return 301 https://$server_name$request_uri; |
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.
return 301may cause some clients/browsers to change non-GET/HEAD requests into a GET when following the redirect (dropping the request body). For an HTTP→HTTPS upgrade redirect this can break POST/PUT API calls; consider using a 308 (or 307) redirect to preserve method and body semantics.