# Request-transformer, config.replace.headers

**URL:** <https://discuss.konghq.com/t/request-transformer-config-replace-headers/3178>\
**Category:** Questions\
**Created:** [April 2, 2019, 5:19pm UTC](https://discuss.konghq.com/t/request-transformer-config-replace-headers/3178 "2019-04-02T17:19:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfalkbjer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/jfalkbjer/32/853_2.png) [@jfalkbjer](https://discuss.konghq.com/u/jfalkbjer)\
**Post date:** [April 2, 2019, 5:19pm UTC](https://discuss.konghq.com/t/request-transformer-config-replace-headers/3178/1 "2019-04-02T17:19:25Z")

</div>

Hi,

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!

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [April 2, 2019, 6:42pm UTC](https://discuss.konghq.com/t/request-transformer-config-replace-headers/3178/2 "2019-04-02T18:42:10Z")

</div>

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

You can use the [serverless](https://docs.konghq.com/hub/kong-inc/serverless-functions/) plugin to achieve this by writing a `pre-function` and leveraging the [PDK](https://docs.konghq.com/latest/pdk/) to do this. Please take a look at the following functions:

> **[Open-Source API Management and Microservice Management](https://docs.konghq.com/1.1.x/pdk/kong.request/#kongrequestget_headername)**
>
> Secure, Manage & Extend your APIs or Microservices with plugins for authentication, logging, rate-limiting, transformations and more.

  

> **[Open-Source API Management and Microservice Management](https://docs.konghq.com/1.1.x/pdk/kong.service.request/#kongservicerequestset_headerheader-value)**
>
> Secure, Manage & Extend your APIs or Microservices with plugins for authentication, logging, rate-limiting, transformations and more.

---

<div class="post-metadata">

**Author:** ![jfalkbjer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/jfalkbjer/32/853_2.png) [@jfalkbjer](https://discuss.konghq.com/u/jfalkbjer)\
**Post date:** [April 2, 2019, 7:01pm UTC](https://discuss.konghq.com/t/request-transformer-config-replace-headers/3178/3 "2019-04-02T19:01:08Z")

</div>

Thanks!  
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!
