# Kong request transformer - Modify http header

**URL:** <https://discuss.konghq.com/t/kong-request-transformer-modify-http-header/8239>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [April 14, 2021, 6:47pm UTC](https://discuss.konghq.com/t/kong-request-transformer-modify-http-header/8239 "2021-04-14T18:47:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sid-git](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@sid-git](https://discuss.konghq.com/u/sid-git)\
**Post date:** [April 14, 2021, 6:47pm UTC](https://discuss.konghq.com/t/kong-request-transformer-modify-http-header/8239/1 "2021-04-14T18:47:32Z")

</div>

I am trying to change the http host header using request transformer, I do not get an error but the header is not getting changed. Similarly I am trying to replace the http host header with the same scenario. Checked the service and also the kong proxy, nothing getting modified. I wonder how we can check the execution of the Kong plugins.

Modify Header

apiVersion: [configuration.konghq.com/v1](http://configuration.konghq.com/v1)  
kind: KongPlugin  
metadata:  
name: host-header-replace  
config:  
replace:  
headers:  
- host: [httpbin.org](http://httpbin.org)  
- security: [httpbin.org](http://httpbin.org)  
plugin: request-transformer

Remove Header

apiVersion: [configuration.konghq.com/v1](http://configuration.konghq.com/v1)  
kind: KongPlugin  
metadata:  
name: remove-host-header-  
config:  
remove:  
headers:  
- host: [httpbin.org](http://httpbin.org)  
plugin: request-transformer

---

<div class="post-metadata">

**Author:** ![traines](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/traines/32/158_2.png) [@traines](https://discuss.konghq.com/u/traines)\
**Post date:** [April 16, 2021, 11:32pm UTC](https://discuss.konghq.com/t/kong-request-transformer-modify-http-header/8239/2 "2021-04-16T23:32:36Z")

</div>

You’ll need to set  
[Kubernetes Ingress Controller annotations - v1.2.x | Kong - Open-Source API Management and Microservice Management](https://docs.konghq.com/kubernetes-ingress-controller/1.2.x/references/annotations/#konghqcomhost-header) on your Service instead.

The `Host` header is handled unlike most other headers, since it’s [set via a template](https://github.com/Kong/kong/blob/2.4.0/kong/templates/nginx_kong.lua#L145), which overrides any `Host` header set by a plugin. It takes its value from a variables set based on routing configuration (the Kong routes and services that the controller generates from your Kubernetes configuration).

---

<div class="post-metadata">

**Author:** ![sid-git](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@sid-git](https://discuss.konghq.com/u/sid-git)\
**Post date:** [April 19, 2021, 7:17pm UTC](https://discuss.konghq.com/t/kong-request-transformer-modify-http-header/8239/3 "2021-04-19T19:17:07Z")

</div>

Thank you for the reply, this worked once I stopped the host name propagation.
