fix(decoredirect): use configuration-snippet to avoid breaking ACME challenges#24
Merged
Merged
Conversation
server-snippet runs at the nginx server block level (HTTP + HTTPS) before location matching, intercepting Let's Encrypt HTTP-01 ACME challenge requests and breaking certificate issuance for new domains. configuration-snippet is scoped to the location / block — the cert-manager ACME solver creates a more specific location (/.well-known/acme-challenge/TOKEN) that takes priority, so challenges are served correctly while path is still preserved via $request_uri on all other requests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
O PR #23 usou
server-snippetpara preservar o path no redirect. Porém oserver-snippetroda no bloco server do nginx (tanto HTTP quanto HTTPS) antes do location matching — isso intercepta as requisições do Let's Encrypt HTTP-01 ACME challenge e quebra a emissão de certificados para novos domínios.Confirmado em produção:
http://zeenow.com.br/.well-known/acme-challenge/TOKENretornava 307 parahttps://www.zeenow.com.br/...em vez de servir o token.Fix
configuration-snippetinjeta oreturnno blocolocation /em vez do blocoserver. O ACME solver do cert-manager cria um location mais específico (/.well-known/acme-challenge/TOKEN) que tem prioridade sobre olocation /— então o challenge é servido corretamente enquanto todos os outros paths continuam sendo redirecionados com o path preservado.Test plan
zeenow.com.bremite certificadooscarcalcados.com.br/promocao-botasainda redireciona com path preservado🤖 Generated with Claude Code
Summary by cubic
Switch redirect annotation to NGINX Ingress
configuration-snippetso ACME HTTP-01 challenges are not intercepted, restoring certificate issuance for new domains. Redirects still preserve path and query via$request_uri.nginx.ingress.kubernetes.io/server-snippetwithnginx.ingress.kubernetes.io/configuration-snippetto scope thereturnto location/, allowingcert-manager’s/.well-known/acme-challenge/*location to win.Written for commit 9f89844. Summary will update on new commits.