# Kong ingress controller not routing based on host header

**URL:** <https://discuss.konghq.com/t/kong-ingress-controller-not-routing-based-on-host-header/12854>\
**Category:** General\
**Tags:** kubernetes\
**Created:** [July 16, 2024, 1:50am UTC](https://discuss.konghq.com/t/kong-ingress-controller-not-routing-based-on-host-header/12854 "2024-07-16T01:50:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandraS](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/chandras/32/4565_2.png) [@chandraS](https://discuss.konghq.com/u/chandraS)\
**Post date:** [July 16, 2024, 1:50am UTC](https://discuss.konghq.com/t/kong-ingress-controller-not-routing-based-on-host-header/12854/1 "2024-07-16T01:50:14Z")

</div>

I am starting off with kong ingress controller and got this basic ingress in place for host header based routing. I can route requests to [service.foo.com](http://service.foo.com) but not to `service.bar.com` , I keep seeing url not found error `service.bar.com` has its DNS records in place, also I could make a curl request to its service endpoint from within the app container. kong logs show no targets could be found for kubernetes service which is confusing to me since I can make a curl request to the endpoint. I port-forwarded kong-proxy and checked the routes locally on [http://localhost:8080/routes](http://localhost:8080/routes) through kong-admin. open to more suggestions

```auto
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: multi-domain-ingress
  annotations:
    konghq.com/plugins: kong-custom-query-routing,tcp-log-plugin
    konghq.com/https-status-redirect-code: "301"
    konghq.com/strip-path: "true"
    konghq.com/preserve-host: "true"
    konghq.com/protocols: http,https
    konghq.com/http-forwarded: "preserve"
spec:
  tls:
    - hosts:
        - service.foo.com
      secretName: secret-cert  
  ingressClassName: kong
  rules:
    - host: service.foo.com
      http:
        paths:
          - path: /a
            pathType: ImplementationSpecific
            backend:
              service:
                name: flask-app
                port:
                  number: 80
          - path: /b
            pathType: ImplementationSpecific
            backend:
              service:
                name: flask-svc
                port:
                  number: 80
          - path: /c
            pathType: ImplementationSpecific
            backend:
              service:
                name: flask-svc
                port:
                  number: 80
          - path: /health
            pathType: ImplementationSpecific
            backend:
              service:
                name: flask-svc
                port:
                  number: 80
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: certbot
                port:
                  number: 80
   - host: service.bar.com
      http:
        paths:
          - path: /a
            pathType: ImplementationSpecific
            backend:
              service:
                name: flask-frontend-svc
                port:
                  number: 80
          - path: /b
            pathType: ImplementationSpecific
            backend:
              service:
                name: flask-frontend-svc
                port:
                  number: 80
          - path: /c
            pathType: ImplementationSpecific
            backend:
              service:
                name: frontend-svc
                port:
                  number: 80
          - path: /d
            pathType: ImplementationSpecific
            backend:
              service:
                name: flask-frontend-svc
                port:
                  number: 80
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: another-service
                port:
                  number: 80

```

---

<div class="post-metadata">

**Author:** ![chandraS](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/chandras/32/4565_2.png) [@chandraS](https://discuss.konghq.com/u/chandraS)\
**Post date:** [July 16, 2024, 2:38pm UTC](https://discuss.konghq.com/t/kong-ingress-controller-not-routing-based-on-host-header/12854/2 "2024-07-16T14:38:00Z")

</div>

it worked after changing strip-path to false. when it was true, it was stripping the paths in the HTTP request and since there’s no ‘/’ in the ingress rules, the request was failing
