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

Kong behind CDN #14269

Open
omegion opened this issue Feb 12, 2025 · 1 comment
Open

Kong behind CDN #14269

omegion opened this issue Feb 12, 2025 · 1 comment
Assignees
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller area/kubernetes Issues where Kong is running on top of Kubernetes

Comments

@omegion
Copy link

omegion commented Feb 12, 2025

Hi,

I am running Kong in my Kubernetes cluster behind a service and a CDN. I have an HTTPRoute with a hostname:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: service-a
spec:
  parentRefs:
    - name: internal
      namespace: gateway-api
  hostnames:
    - service-a.private-domain
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /
      backendRefs:
        - name: deployment
          port: 80

The problem is that I accept traffic to service-a.example.com public domain, but my internal hostname is service-a.private-domain, but Kong gets the Host header as service-a.example.com and does not match any route.

How can I ignore the Host header of my CDN?

@xianghai2 xianghai2 added area/kubernetes Issues where Kong is running on top of Kubernetes area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller labels Feb 14, 2025
@Water-Melon
Copy link
Contributor

Hi @omegion , you can try using the request-transformer plugin to achieve your goal. Please refer to the documentation for more details. https://docs.konghq.com/hub/kong-inc/request-transformer/how-to/#example-adding-a-querystring-and-a-header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller area/kubernetes Issues where Kong is running on top of Kubernetes
Projects
None yet
Development

No branches or pull requests

3 participants