How to remove Server header with kong response-transformer plugin?

Viewed 3324

I'm trying to remove the Server header by using the following declarative map in a serverless approach:

plugins:
  - name: response-transformer
    service: my-service
    config:
      remove.headers: Server

but I get:

in 'plugins':
 - in entry 1 of 'plugins':
in 'config':
  in 'remove.headers': unknown field

I also tried to override the value but it just seems that the above configuration has something missing...what am I doing wrong?

3 Answers

The format is like this

- name: response-transformer
    service: my-service
    config:
      remove:
        headers: ["Server","Via"]

The following kong configuration can be used to get rid of the "Via" header:

- name: KONG_HEADERS
  value: "off"

This removes the kong related headers. However, this doesn't seem to remove the "Server" header.

Related