<p>I am trying to disable all HTTP ingress traffic for a specific API. I tried deleting the ingress and recreating after adding this annotation <code>kubernetes.io/ingress.allow-http: &quot;false&quot;</code> , but that doesn't work too. I can still hit the API and get a response on http://&lt;ingress-dns-name/shipping-address/api</p>
<ul>
<li>Both Nginx Controller and the API are deployed of course on the same azure Kubernetes cluster.</li>
<li>A secret <code>my-tls-secret</code> is created in the default namespace</li>
<li>Nginx controller has its own namespace</li>
</ul>
<p>Here is the ingress yaml file:</p>
<pre><code>kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.allow-http: &quot;false&quot;
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$2
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
  name: api-shipping-address-ingress
  namespace: nonprod-dev
  resourceVersion: &quot;31734103&quot;
  uid: c9a698a0-3d2e-4f3b-99a9-c16c6fa83774
spec:
  rules:
  - http:
      paths:
      - backend:
          service:
            name: api-shipping-address
            port:
              number: 3000
        path: /shipping-address(/|$)(.*)
        pathType: ImplementationSpecific
  tls:
  - secretName: my-tls-secret
status:
  loadBalancer:
    ingress:
    - ip: 10.86.168.200
</code></pre>

Hussein Salman
<p>I had the same problem and solved it by adding <code>nginx.ingress.kubernetes.io/force-ssl-redirect: &quot;true&quot;</code> as described in <a href="https://kubernetes.github.io/ingress-nginx/user-guide/tls/#server-side-https-enforcement-through-redirect" rel="nofollow noreferrer">the ingress-nginx documentation</a></p>
