Fix force-ssl-redirect routing 418 when TLS is terminated upstream#13386
Merged
traefiker merged 1 commit intoJun 25, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes kubernetesIngressNGINX translation for force-ssl-redirect/ssl-redirect so that when TLS is terminated upstream (and Traefik receives HTTP with X-Forwarded-Proto: https), requests correctly reach the real backend instead of falling through to noop@internal (HTTP 418).
Changes:
- Stop overwriting HTTP router services with
noop@internaland remove the early return inapplyMiddlewaresfor SSL-redirect-only HTTP routers. - Update ingress-nginx provider unit test expectations so redirecting HTTP routers keep the real backend service and still receive the full middleware chain (e.g., retry).
- Add a regression fixture + test case for
force-ssl-redirectwithout an Ingress TLS section (LB-terminated TLS scenario).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/provider/kubernetes/ingress-nginx/translator.go |
Keeps the original backend service for SSL redirect HTTP routers and continues applying remaining middlewares instead of returning early. |
pkg/provider/kubernetes/ingress-nginx/kubernetes_test.go |
Adjusts expected router service/middleware chains and adds a regression test covering LB-terminated TLS with force-ssl-redirect. |
pkg/provider/kubernetes/ingress-nginx/fixtures/ingresses/ingress-with-force-ssl-redirect-no-tls.yml |
Adds a fixture Ingress enabling force-ssl-redirect without a TLS section to reproduce/guard the reported 418 behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Hey @carloslima, Thank you for your contribution. We've set the status to "design-review" to allow us to check the PR and ensure there is no deep impact on Traefik before moving forward. We'll keep you updated once the analysis is done. |
When an Ingress uses force-ssl-redirect (or ssl-redirect via a TLS section) and TLS is terminated by an upstream load balancer, Traefik receives plain HTTP with X-Forwarded-Proto: https. The RedirectScheme middleware correctly skips the redirect in this case, but the request then hit noop@internal (which always returns HTTP 418) because applyMiddlewares unconditionally overwrote the router service with noop@internal and returned early, discarding all other middlewares. Remove the noop@internal overwrite and the early return. The real backend service is already set on the router before applyMiddlewares is called, so the redirect path is unchanged: when the redirect fires it short-circuits the chain and the service is never reached. When X-Forwarded-Proto: https bypasses the redirect, the request now reaches the real backend through the full middleware chain.
mmatur
force-pushed
the
fix/ingress-nginx-force-ssl-redirect-noop-lb-tls
branch
from
June 25, 2026 08:14
9f29b72 to
0620334
Compare
mmatur
approved these changes
Jun 25, 2026
2 tasks
JuliusFreudenberger
pushed a commit
to JuliusFreudenberger/nix-config
that referenced
this pull request
Jul 2, 2026
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [traefik](https://github.com/containous/traefik) | patch | `v3.7.5` → `v3.7.6` | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/12) for more information. --- ### Release Notes <details> <summary>containous/traefik (traefik)</summary> ### [`v3.7.6`](https://github.com/containous/traefik/blob/HEAD/CHANGELOG.md#v376-2026-06-30) [Compare Source](traefik/traefik@v3.7.6...v3.7.6) [All Commits](traefik/traefik@v3.7.5...v3.7.6) **Bug fixes:** - **\[acme, logs]** Bump github.com/go-acme/lego/v5 ([#​13154](traefik/traefik#13154) [@​ldez](https://github.com/ldez)) - **\[acme]** Bump github.com/go-acme/lego/v5 ([#​13359](traefik/traefik#13359) [@​juliens](https://github.com/juliens)) - **\[k8s, k8s/ingress-nginx]** Fix ingress-nginx ssl passthrough status updates ([#​13212](traefik/traefik#13212) [@​nickmnt](https://github.com/nickmnt)) - **\[k8s/gatewayapi]** Add missing Gateway API features in conformance tests ([#​13356](traefik/traefik#13356) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[k8s/gatewayapi]** Avoid collisions for Gateway API services names ([#​13367](traefik/traefik#13367) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/gatewayapi]** Ignore other gateways parentRefs and update route parent statuses only for managed gateways ([#​13397](traefik/traefik#13397) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/ingress-nginx]** Configure retry according to buffering configuration ([#​13039](traefik/traefik#13039) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/ingress-nginx]** Fix force-ssl-redirect routing 418 when TLS is terminated upstream ([#​13386](traefik/traefik#13386) [@​carloslima](https://github.com/carloslima)) - **\[k8s]** Detect EndpointSlice condition changes ([#​13405](traefik/traefik#13405) [@​kevinpollet](https://github.com/kevinpollet)) - **\[k8s]** Index Kubernetes EndpointSlice by service name ([#​13395](traefik/traefik#13395) [@​kevinpollet](https://github.com/kevinpollet)) - **\[k8s]** Sort endpointslices to keep backend IPs consistent across rebuilds ([#​13406](traefik/traefik#13406) [@​kevinpollet](https://github.com/kevinpollet)) - **\[kv]** Bump kvtools/redis to v1.2.1 ([#​13403](traefik/traefik#13403) [@​ldez](https://github.com/ldez)) - **\[middleware, authentication]** Fix x-forwarded-port in forward-auth ([#​13344](traefik/traefik#13344) [@​juliens](https://github.com/juliens)) - **\[middleware, k8s/gatewayapi]** Fix Gateway API redirect missing statuses ([#​13360](traefik/traefik#13360) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[middleware, k8s/gatewayapi]** Fix Host header not being modified by RequestHeaderModifier ([#​12805](traefik/traefik#12805) [@​mihuross](https://github.com/mihuross)) - **\[middleware, k8s/gatewayapi]** Fix request scheme derivation when Gateway API RequestRedirect omits scheme ([#​13347](traefik/traefik#13347) [@​gndz07](https://github.com/gndz07)) - **\[middleware]** Fix CORS Max-Age set to 0 by default ([#​13371](traefik/traefik#13371) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[middleware]** Fix CORS wildcard when allow-credentials is true ([#​13368](traefik/traefik#13368) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[server]** Add an option to remove request headers with underscores ([#​13262](traefik/traefik#13262) [@​youkoulayley](https://github.com/youkoulayley)) - **\[server]** Configurable max request header size ([#​13353](traefik/traefik#13353) [@​juliens](https://github.com/juliens)) - **\[tls]** Fix nondeterministic TLS certificate selection on shared SAN ([#​13348](traefik/traefik#13348) [@​rtribotte](https://github.com/rtribotte)) - **\[webui]** Bump axios to v1.18.0 ([#​13380](traefik/traefik#13380) [@​gndz07](https://github.com/gndz07)) - **\[websocket]** Fix connection upgrades when backend server is using h2c scheme ([#​12967](traefik/traefik#12967) [@​stffabi](https://github.com/stffabi)) **Documentation:** - **\[k8s/crd]** Fix broken CRD reference links in IngressRoute page ([#​13375](traefik/traefik#13375) [@​s3onghyun](https://github.com/s3onghyun)) - **\[k8s/gatewayapi]** Remove experimental note for Gateway API/TLSRoute documentation ([#​13392](traefik/traefik#13392) [@​jnoordsij](https://github.com/jnoordsij)) - **\[k8s/ingress-nginx]** Add Kubernetes Ingress NGINX to the providers list ([#​13372](traefik/traefik#13372) [@​nmengin](https://github.com/nmengin)) - **\[k8s]** Align Helm chart documented values with chart v41 ([#​13366](traefik/traefik#13366) [@​mloiseleur](https://github.com/mloiseleur)) - **\[middleware, authentication, k8s/ingress-nginx]** Clarify intentional auth-response-headers gating and absence of stripping incoming X-Forwarded-\* headers ([#​13342](traefik/traefik#13342) [@​rtribotte](https://github.com/rtribotte)) - **\[middleware]** Clarify entryPoint middleware reference format ([#​13364](traefik/traefik#13364) [@​mloiseleur](https://github.com/mloiseleur)) - **\[security]** Add HTTP/2 header memory exhaustion security documentation ([#​13381](traefik/traefik#13381) [@​emilevauge](https://github.com/emilevauge)) - Adds documentations on maxHeaderBytes ([#​13363](traefik/traefik#13363) [@​juliens](https://github.com/juliens)) - Fix inaccuracies in reference documentation ([#​13304](traefik/traefik#13304) [@​sheddy-traefik](https://github.com/sheddy-traefik)) ### [`v3.7.6`](https://github.com/containous/traefik/blob/HEAD/CHANGELOG.md#v376-2026-06-30) [Compare Source](traefik/traefik@v3.7.5...v3.7.6) [All Commits](traefik/traefik@v3.7.5...v3.7.6) **Bug fixes:** - **\[acme, logs]** Bump github.com/go-acme/lego/v5 ([#​13154](traefik/traefik#13154) [@​ldez](https://github.com/ldez)) - **\[acme]** Bump github.com/go-acme/lego/v5 ([#​13359](traefik/traefik#13359) [@​juliens](https://github.com/juliens)) - **\[k8s, k8s/ingress-nginx]** Fix ingress-nginx ssl passthrough status updates ([#​13212](traefik/traefik#13212) [@​nickmnt](https://github.com/nickmnt)) - **\[k8s/gatewayapi]** Add missing Gateway API features in conformance tests ([#​13356](traefik/traefik#13356) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[k8s/gatewayapi]** Avoid collisions for Gateway API services names ([#​13367](traefik/traefik#13367) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/gatewayapi]** Ignore other gateways parentRefs and update route parent statuses only for managed gateways ([#​13397](traefik/traefik#13397) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/ingress-nginx]** Configure retry according to buffering configuration ([#​13039](traefik/traefik#13039) [@​rtribotte](https://github.com/rtribotte)) - **\[k8s/ingress-nginx]** Fix force-ssl-redirect routing 418 when TLS is terminated upstream ([#​13386](traefik/traefik#13386) [@​carloslima](https://github.com/carloslima)) - **\[k8s]** Detect EndpointSlice condition changes ([#​13405](traefik/traefik#13405) [@​kevinpollet](https://github.com/kevinpollet)) - **\[k8s]** Index Kubernetes EndpointSlice by service name ([#​13395](traefik/traefik#13395) [@​kevinpollet](https://github.com/kevinpollet)) - **\[k8s]** Sort endpointslices to keep backend IPs consistent across rebuilds ([#​13406](traefik/traefik#13406) [@​kevinpollet](https://github.com/kevinpollet)) - **\[kv]** Bump kvtools/redis to v1.2.1 ([#​13403](traefik/traefik#13403) [@​ldez](https://github.com/ldez)) - **\[middleware, authentication]** Fix x-forwarded-port in forward-auth ([#​13344](traefik/traefik#13344) [@​juliens](https://github.com/juliens)) - **\[middleware, k8s/gatewayapi]** Fix Gateway API redirect missing statuses ([#​13360](traefik/traefik#13360) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[middleware, k8s/gatewayapi]** Fix Host header not being modified by RequestHeaderModifier ([#​12805](traefik/traefik#12805) [@​mihuross](https://github.com/mihuross)) - **\[middleware, k8s/gatewayapi]** Fix request scheme derivation when Gateway API RequestRedirect omits scheme ([#​13347](traefik/traefik#13347) [@​gndz07](https://github.com/gndz07)) - **\[middleware]** Fix CORS Max-Age set to 0 by default ([#​13371](traefik/traefik#13371) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[middleware]** Fix CORS wildcard when allow-credentials is true ([#​13368](traefik/traefik#13368) [@​AnatoleLucet](https://github.com/AnatoleLucet)) - **\[server]** Add an option to remove request headers with underscores ([#​13262](traefik/traefik#13262) [@​youkoulayley](https://github.com/youkoulayley)) - **\[server]** Configurable max request header size ([#​13353](traefik/traefik#13353) [@​juliens](https://github.com/juliens)) - **\[tls]** Fix nondeterministic TLS certificate selection on shared SAN ([#​13348](traefik/traefik#13348) [@​rtribotte](https://github.com/rtribotte)) - **\[webui]** Bump axios to v1.18.0 ([#​13380](traefik/traefik#13380) [@​gndz07](https://github.com/gndz07)) - **\[websocket]** Fix connection upgrades when backend server is using h2c scheme ([#​12967](traefik/traefik#12967) [@​stffabi](https://github.com/stffabi)) **Documentation:** - **\[k8s/crd]** Fix broken CRD reference links in IngressRoute page ([#​13375](traefik/traefik#13375) [@​s3onghyun](https://github.com/s3onghyun)) - **\[k8s/gatewayapi]** Remove experimental note for Gateway API/TLSRoute documentation ([#​13392](traefik/traefik#13392) [@​jnoordsij](https://github.com/jnoordsij)) - **\[k8s/ingress-nginx]** Add Kubernetes Ingress NGINX to the providers list ([#​13372](traefik/traefik#13372) [@​nmengin](https://github.com/nmengin)) - **\[k8s]** Align Helm chart documented values with chart v41 ([#​13366](traefik/traefik#13366) [@​mloiseleur](https://github.com/mloiseleur)) - **\[middleware, authentication, k8s/ingress-nginx]** Clarify intentional auth-response-headers gating and absence of stripping incoming X-Forwarded-\* headers ([#​13342](traefik/traefik#13342) [@​rtribotte](https://github.com/rtribotte)) - **\[middleware]** Clarify entryPoint middleware reference format ([#​13364](traefik/traefik#13364) [@​mloiseleur](https://github.com/mloiseleur)) - **\[security]** Add HTTP/2 header memory exhaustion security documentation ([#​13381](traefik/traefik#13381) [@​emilevauge](https://github.com/emilevauge)) - Adds documentations on maxHeaderBytes ([#​13363](traefik/traefik#13363) [@​juliens](https://github.com/juliens)) - Fix inaccuracies in reference documentation ([#​13304](traefik/traefik#13304) [@​sheddy-traefik](https://github.com/sheddy-traefik)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.jfreudenberger.de/JuliusFreudenberger/nix-config/pulls/16 Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
traefiker
pushed a commit
to mmatur/ingress-nginx-migration
that referenced
this pull request
Jul 15, 2026
Add two tests to validate that X-Forwarded-Proto: https bypasses the ssl-redirect middleware and reaches the backend (instead of hitting noop@internal and returning 418). Also update fixtures: - Pin Traefik helm chart to v41.0.0 and fix renamed keys (logs->log, kubernetesIngressNginx->kubernetesIngressNGINX) - Enable forwardedHeaders.insecure on web entrypoint so Traefik trusts X-Forwarded-Proto from test clients - Enable use-forwarded-headers in nginx so it also bypasses redirect on X-Forwarded-Proto: https Relates to traefik/traefik#13386
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.
What does this PR do?
Remove the
noop@internaloverwrite and the early return fromapplyMiddlewaresiningress-nginx/translator.go. The real backend service is already set on the router beforeapplyMiddlewaresis called, so the redirect path is unchanged: when the redirect fires it short-circuits the chain and the service is never reached. WhenX-Forwarded-Proto: httpsbypasses the redirect, the request now reaches the real backend through the full middleware chain.Motivation
When an Ingress uses
force-ssl-redirect(orssl-redirectvia a TLS section) and TLS is terminated by an upstream load balancer, Traefik receives plain HTTP withX-Forwarded-Proto: https. The RedirectScheme middleware correctly skips the redirect in this case, but the request then hitnoop@internal(which always returns HTTP 418) becauseapplyMiddlewaresunconditionally overwrote the router service withnoop@internaland returned early, discarding all other middlewares.More
Closes #13385