title: Kubernetes - multiple configuration in one Ingress
body: <p>I have different applications running in the same Kubernetes Cluster.</p>
  <p>I would like multiple domains to access my Kubernetes Cluster and be redirected depending the domain.
  For each domain I would like different annotations/configuration.</p>
  <p>Without the annotations I have an ingress deployment such as:</p>
  <pre><code>apiVersion: networking.k8s.io/v1beta1
  kind: Ingress
  metadata:
    name: frontdoor
    namespace: myapps
    annotations:
      kubernetes.io/ingress.class: nginx
      cert-manager.io/cluster-issuer: letsencrypt-prod
  spec:
    type: LoadBalancer
    tls:
      - hosts:
          - foo.bar.dev
          - bar.foo.dev
        secretName: tls-secret
    rules:
      - host: foo.bar.dev
        http:
          paths:
            - backend:
                serviceName: foobar
                servicePort: 9000
              path: /(.*)
      - host: bar.foo.dev
        http:
          paths:
            - backend:
                serviceName: varfoo
                servicePort: 80
              path: /(.*)
  </code></pre>
  <p>But They need to have multiple configuration, for example, one need to have the following annotation</p>
  <pre><code>    nginx.ingress.kubernetes.io/rewrite-target: /$1
      nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
      nginx.ingress.kubernetes.io/affinity: &quot;cookie&quot;
      nginx.ingress.kubernetes.io/session-cookie-name: &quot;PHPSESSID&quot;
      nginx.ingress.kubernetes.io/session-cookie-expires: &quot;172800&quot;
      nginx.ingress.kubernetes.io/session-cookie-max-age: &quot;172800&quot;
  </code></pre>
  <p>And another would have this one</p>
  <pre><code>    nginx.ingress.kubernetes.io/backend-protocol: &quot;FCGI&quot;
      nginx.ingress.kubernetes.io/fastcgi-index: &quot;index.php&quot;
      nginx.ingress.kubernetes.io/fastcgi-params-configmap: &quot;example-cm&quot;
  </code></pre>
  <p><strong>Those configurations are not compatible</strong>, and I can't find a way to specify a configuration by host.</p>
  <p>I also understand that it's impossible to have 2 Ingress serving External HTTP request.</p>
  <p>So what am I not understanding / doing wrong ?</p>