Skip to content
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

smallstep nginx: use resolver to handle offline proxy targets #3946

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog.d/5-internal/smallstep-accomp-target-resolving
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Ensure that targets of the smallstep nginx proxy are resolved at runtime via the
configured DNS server. This has two benefits: The target gets adjusted when it's
changed at the DNS server. And, nginx doesn't fail to start when the target
doesn't exist yet.
8 changes: 6 additions & 2 deletions charts/smallstep-accomp/templates/server-block-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ data:
{{- range .Values.upstreams.proxiedHosts }}

location /proxyCrl/{{ . }} {
# This indirection is required to make the resolver check the domain.
# Otherwise, broken upstreams lead to broken deployments.
set $backend "{{ . }}";

proxy_redirect off;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header Host {{ . }};
proxy_set_header Host $backend;
proxy_hide_header Content-Type;
add_header Content-Type application/pkix-crl;
proxy_pass "https://{{ . }}/crl";
proxy_pass "https://$backend/crl";
}

{{- end }}
Expand Down