<p>I am trying to use Nginx ingress to access kubernetes dashboard on my local pc. The step I followed are:</p>
<p>Getting nginx ingress</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.48.1/deploy/static/provider/cloud/deploy.yaml
</code></pre>
<p>Getting kubernetes dashboard</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml
</code></pre>
<p>Applying this ingress</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kubernetes-dashboard
spec:
  rules:
  - host: &quot;kubernetes.docker.internal&quot;
    http:
      paths:
      - pathType: Prefix
        path: &quot;/&quot;
        backend:
          service:          
            name: kubernetes-dashboard
            port: 
              number: 443
</code></pre>
<p>Checking that my host file has this line</p>
<pre><code>127.0.0.1 kubernetes.docker.internal
</code></pre>
<p>If I try to open <a href="http://kubernetes.docker.internal/" rel="nofollow noreferrer">http://kubernetes.docker.internal/</a> on my browser I get &quot;Http Error 400 this page isn't working&quot;, while on postman I get an error 400 with message &quot;Client sent an HTTP request to an HTTPS server.&quot;</p>
<p>How can I resolve?</p>

Iachin
<p>I resolved adding annotations section in ingress yaml.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kubernetes-dashboard
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
    nginx.ingress.kubernetes.io/ssl-passthrough: &quot;true&quot;
    nginx.ingress.kubernetes.io/backend-protocol: &quot;HTTPS&quot;
spec:
  rules:
  - host: &quot;kubernetes.docker.internal&quot;
    http:
      paths:
      - pathType: Prefix
        path: &quot;/&quot;
        backend:
          service:          
            name: kubernetes-dashboard
            port: 
              number: 443
</code></pre>
