# Combination of Host and Port Based Routing Options Via Ingress Controller

**URL:** https://discuss.kubernetes.io/t/combination-of-host-and-port-based-routing-options-via-ingress-controller/18767
**Category:** General Discussions
**Created:** [January 18, 2022, 5:23pm UTC](https://discuss.kubernetes.io/t/combination-of-host-and-port-based-routing-options-via-ingress-controller/18767 "2022-01-18T17:23:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Natarajan\_Ramani](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/natarajan_ramani/32/9329_2.png) [@Natarajan\_Ramani](https://discuss.kubernetes.io/u/Natarajan_Ramani)
#### Post date: [January 18, 2022, 5:23pm UTC](https://discuss.kubernetes.io/t/combination-of-host-and-port-based-routing-options-via-ingress-controller/18767/1 "2022-01-18T17:23:54Z")

</div>

Is there a way to do combination of host and port based routing using ingress controllers? I went through [ingress-nginx/exposing-tcp-udp-services.md at main · kubernetes/ingress-nginx · GitHub](https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/exposing-tcp-udp-services.md) documentation. But from the doc I’m inferring that it will always get routed to only one service, regardless of any host. Below is our use case

```auto
{
  server host1.mydomain.com;
  listen 443 ssl;
  ....
  location / {
    proxy_pass http://namespace-1-service-a:8080;
  }
}

{
  server host1.mydomain.com;
  listen 8443 ssl;
  ssl_verify_client_cert on; # verifying client certificate when the same endpoint is reached via 8443 port
  location / {
    proxy_pass http://namespace-1-service-a:8080;
  }
}

{
  server host2.mydomain.com;
  listen 443 ssl;
  ....
  location / {
    proxy_pass http://namespace-2-service-a:8080;
  }
...
}

```

Above kind of configs are possible in nginx as such. But with ingress controller is it possible to achieve it? How these kind of use cases are solved widely when people are adopting Kubernetes?
