Request-transformer, config.replace.headers


When the request comes to Kong it contains an http header.
I want to take that http header and put in another http header, but I don’t get get it to work.
I thought I could do like:

--data "config.replace.headers=header1:\$header2"

with the request-transformer plugin, where the value of header2 would end up in header1.
Maybe it is not possible, or is my syntax just wrong?

Please advice.

Thank you!

Pretty sure this is not possible using the request-transformer plugin.

You can use the serverless plugin to achieve this by writing a pre-function and leveraging the PDK to do this. Please take a look at the following functions:

Serverles will work. Have used it for other stuff.
It would be a nice feature for the request-transformer to be able to read header from Nginx and set on another.
Thanks again for your respons!