goauthentik / goauthentik/authentik
Kubernetes GatewayAPI HTTPRoutes using Traefik result in 404 page not found
- Dominant language
- Python
- Stars
- 25.6k
- Forks
- 2k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 659
Description
### Discussed in https://github.com/goauthentik/authentik/discussions/18345
Originally posted by **ImmanuelVonNeumann** September 15, 2025
**Describe the bug**
When switching from Ingress to HTTPRoutes the default HttpRoute ``ak-outpost-authentik-embedded-outpost`` does not work on traefik, instead a ``404 page not found`` is returned.
**To Reproduce**
Steps to reproduce the behavior:
1. Follow https://github.com/goauthentik/authentik/issues/14070#issuecomment-2824792075 to switch from Ingress to HTTPRoutes
2. Try to access any Host/App
3. See error
**Expected behavior**
The respective app should be served
**Screenshots**
\-
**Logs**
\-
**Version and Deployment (please complete the following information):**
- authentik version: 2025.8.2
- Deployment: helm
- Traefik Version: 3.5.2
**Additional context**
Imagine we have two (Proxy-)Applications set up in authentik: ``route1``, ``route2``.
When inspecting the generated route for ``route1`` in the Traefik Dashboard, it will look something like this:
```
(Host(`route1.host.tld`) || Host(`route2.host.tld`) && PathPrefix(`/`) && Header(`Host`,`route1.host.tld`)
```
While this looks a lot more clumsy than the Ingress implementation (by showing all hosts in the rule) the issue does stem from the last rule: Header(`Host`,`route1.host.tld`).
This header seems not to be propagated but rather ``X-Forwarded-Host`` [Source](https://doc.traefik.io/traefik/reference/routing-configuration/http/middlewares/headers/#Host)
Now to solve this we could update the Header-Name (which might not be compatible with other Gateway-Implementations) by changing ``Header(`Host`,`route1.host.tld`)`` to ``Header(`X-Forwarded-Host`,`route1.host.tld`)``.
Another approach would be to rely on the documented ``spec.hostnames``-field of HttpRoutes, using an individual HttpRoute for each assigned Application (or per Outpost).
Contributor guide
Assessment
This issue has not been assessed yet.