# How to config service host via Kong Ingress?

**URL:** <https://discuss.konghq.com/t/how-to-config-service-host-via-kong-ingress/6062>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [April 17, 2020, 12:02pm UTC](https://discuss.konghq.com/t/how-to-config-service-host-via-kong-ingress/6062 "2020-04-17T12:02:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dieunb](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/dieunb/32/1858_2.png) [@dieunb](https://discuss.konghq.com/u/dieunb)\
**Post date:** [April 17, 2020, 12:02pm UTC](https://discuss.konghq.com/t/how-to-config-service-host-via-kong-ingress/6062/1 "2020-04-17T12:02:41Z")

</div>

I am using kong chart 1.5 with kong ingress controller 0.8.0 to deploy kong to our cluster via helm release.

I saw the service host has created automation when I set up via Ingress. Imagine it is `review-web.staging.80.svc`.

Now, I want to change it to another value. For example:

- Change it to domain `api.staging.example.com`
- Or point to another internal service `another-service.staging.80.svc`

By manual, I can do it, but I wonder how to do that via Kong Ingress?

---

<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 20, 2020, 9:09pm UTC](https://discuss.konghq.com/t/how-to-config-service-host-via-kong-ingress/6062/2 "2020-04-20T21:09:45Z")

</div>

You can set `upstream.host_header` in a KongIngress resource and then annotate your service using `konghq.com/override`. This will change the host-header to the value you prefer.

---

<div class="post-metadata">

**Author:** ![dieunb](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/dieunb/32/1858_2.png) [@dieunb](https://discuss.konghq.com/u/dieunb)\
**Post date:** [April 23, 2020, 7:16am UTC](https://discuss.konghq.com/t/how-to-config-service-host-via-kong-ingress/6062/3 "2020-04-23T07:16:33Z")

</div>

@hbagdi  
Let me show you my configuration:

```
---
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
  name: demo-ki
  namespace: default
upstream:
  host_header: "echo.internal.local"
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: demo
  namespace: default
  annotations:
    konghq.com/override: demo-ki
spec:
  rules:
  - http:
      paths:
      - path: /foo
        backend:
          serviceName: echo
          servicePort: 80 

```

After I applied that config, I expect the value of the service host is `echo.internal.local`. But it is not the same.

 ![Screen Shot 2020-04-23 at 2.13.22 PM 2](https://canada1.discourse-cdn.com/flex036/uploads/konghq/original/2X/6/64f5f5fea529d533077f43a60d9b423c4616c19f.png)

---

<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 23, 2020, 10:54pm UTC](https://discuss.konghq.com/t/how-to-config-service-host-via-kong-ingress/6062/4 "2020-04-23T22:54:28Z")

</div>

Two things:

1. You need to put the `konghq.com/override` annotation on the Service resource for this to work.
2. You will still not see the the `host` property of Service change. You will see the `host_header` property of the corresponding `Upstream` change.

---

<div class="post-metadata">

**Author:** ![dieunb](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/dieunb/32/1858_2.png) [@dieunb](https://discuss.konghq.com/u/dieunb)\
**Post date:** [April 25, 2020, 10:20am UTC](https://discuss.konghq.com/t/how-to-config-service-host-via-kong-ingress/6062/5 "2020-04-25T10:20:38Z")

</div>

Thank you for your prompt reply.  
I have tested by following your guide and it worked with two things you noted.
