Kong Ingress Controller - Remove Kong related headers Kong Ingress Controller - Remove Kong related headers kubernetes kubernetes

Kong Ingress Controller - Remove Kong related headers


You can disable these headers via the headers configuration property. Also noted on the same page is the fact that configuration properties can also be specified as environment variables.

You can thus update your Deployment to specify the headers = off property as an environment variable. Something similar to:

apiVersion: apps/v1kind: Deploymentmetadata:  name: ingress-kong  namespace: kongspec:  template:    spec:      containers:        name: proxy        image: kong:2.0.3        env:        - name: KONG_HEADERS          value: off


I had the exact problem and fixed it after finding this thread.As I'm directly building Docker image of kong, I added below step in Docker file to inject the to inject the environment variable

ENV KONG_HEADERS='off'


@thibaultcha is right.looking at the https://github.com/Kong/kong/blob/9f2b1d984057336cc6075c287ec38ad59323fe6e/kong.conf.default#L656We can see the definition of the headers.the headers environment is changed to KONG_HEADERS

all that needs to be done when using Helm is to add to the values.yaml file the headers with "off"

env:  headers: 'off'