<p>I have ingress yaml like below which makes ingress to proxy HTTPS to HTTP connection. I'm confused how can I make this same ingress to process also HTTP to HTTP connection. Meaning I want it to use the same rule for both incoming HTTP or HTTPS. Removing <code>tls</code> portion makes it work with HTTP but adding it stops HTTP and makes it HTTPS only. Is it limitation of Kubernetes which prevents both HTTP and HTTPS routing in the same ingress controller?</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
spec:
  tls:
    - hosts:
        - &quot;*.mydomain.com&quot;
      secretName: aks-ingress-tls
  rules:
    - host: &quot;*.mydomain.net&quot;
      http:
        paths:
          - pathType: Prefix
            path: &quot;/&quot;
            backend:
              service:
                name: frontend-service
                port:
                  number: 80
</code></pre>

<p>You should redirect the HTTP request to your HTTPS listener. The requests hitting your Azure LB 80/443 listeners will be handled in the same way.</p>
<p>Due to Azure App gateway <a href="https://github.com/Azure/application-gateway-kubernetes-ingress/issues/1001" rel="nofollow noreferrer">limitation</a>, you cannot use a wildcard host in your ingress rules and you have to use workarounds.</p>
<p>See: <a href="https://azure.github.io/application-gateway-kubernetes-ingress/annotations/#ssl-redirect" rel="nofollow noreferrer">https://azure.github.io/application-gateway-kubernetes-ingress/annotations/#ssl-redirect</a></p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/ssl-redirect: &quot;true&quot;
spec:
  tls:
    - hosts:
        - &quot;*.mydomain.com&quot;
      secretName: aks-ingress-tls
  rules:
    - host: &quot;www.mydomain.com&quot;
      http:
        paths:
          - pathType: Prefix
            path: &quot;/&quot;
            backend:
              service:
                name: frontend-service
                port:
                  number: 80
</code></pre>
