# Allow 'host-header' to overwrite 'preserve-host'

**URL:** <https://discuss.konghq.com/t/allow-host-header-to-overwrite-preserve-host/8689>\
**Category:** Feature Requests & Feedback\
**Created:** [July 12, 2021, 7:21pm UTC](https://discuss.konghq.com/t/allow-host-header-to-overwrite-preserve-host/8689 "2021-07-12T19:21:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dputnamWM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/dputnamwm/32/2869_2.png) [@dputnamWM](https://discuss.konghq.com/u/dputnamWM)\
**Post date:** [July 12, 2021, 7:21pm UTC](https://discuss.konghq.com/t/allow-host-header-to-overwrite-preserve-host/8689/1 "2021-07-12T19:21:11Z")

</div>

I’m specifically working in a k8s environment using the kong ingresscontroller (and I haven’t used kong elsewhere), so forgive me if this is irrelevant to other kong applications.

There are currently two ways in kong to edit the host header as a request passes through the ingress controller: a ‘host-header’ annotation on the service, or a ‘preserve-host’ annotation on the ingress. According to the docs, ‘preserve-host’ takes precedence over ‘host-header’: Kong Google Cloud Logging plugin | Kong

And that’s totally fine… EXCEPT:

In version 0.4.0 of kong, ya’ll set ‘preserve\_hosts’ to a default of ‘true’. It looks like that’s still the case…

…which means, out of the box, ‘host-header’ does nothing. New users expecting ‘host-header’ to work also need to use the ‘preserve-host’ annotation on their ingress or find some way to overwrite the ‘preserve\_hosts’ default inside the ingress controller. I know finding this information led me on a bit of a goose chase!

It might be wise to allow ‘host-header’ to overwrite ‘preserve-host’ as opposed to vice-versa. After all, if you’re explicitly specifying a host-header, you’re definitely trying to overwrite whatever OTHER value is in the host header!
