<p>I did nginx ingress controller tutorial from <a href="https://github.com/kubernetes/ingress-nginx/blob/master/deploy/README.md" rel="noreferrer">github</a> and
exposed kubernetes dashboard</p>

<pre><code>kubernetes-dashboard   NodePort    10.233.53.77    &lt;none&gt;        443:31925/TCP   20d
</code></pre>

<p>created ingress </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    ingress.kubernetes.io/ssl-passthrough: "true"
    nginx.org/ssl-backends: "kubernetes-dashboard"
    kubernetes.io/ingress.allow-http: "false"
  name: dashboard-ingress
  namespace: kube-system
spec:
  tls:
  - hosts:
    - serverdnsname
    secretName: kubernetes-dashboard-certs
  rules:
  - host: serverdnsname
    http:
      paths:
      - path: /dashboard
        backend:
          serviceName: kubernetes-dashboard
          servicePort: 443
</code></pre>

<hr>

<pre><code>ingress-nginx   ingress-nginx          NodePort    10.233.21.200   &lt;none&gt;        80:30827/TCP,443:32536/TCP   5h
</code></pre>

<p><a href="https://serverdnsname:32536/dashboard" rel="noreferrer">https://serverdnsname:32536/dashboard</a>
but dashboard throws error </p>

<pre><code>2018/01/18 14:42:51 http: TLS handshake error from ipWhichEndsWith.77:52686: tls: first record does not look like a TLS handshake
</code></pre>

<p>and ingress controller logs</p>

<pre><code>2018/01/18 14:42:51 [error] 864#864: *37 upstream sent no valid HTTP/1.0 header while reading response header from upstream, client: 10.233.82.1, server: serverdnsname, request: "GET /dashboard HTTP/2.0", upstream: "http://ipWhichEndsWith.249:8443/dashboard", host: "serverdnsname:32536"
10.233.82.1 - [10.233.82.1] - - [18/Jan/2018:14:42:51 +0000] "GET /dashboard HTTP/2.0" 009 7 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 OPR/49.0.2725.64" 25 0.001 [kube-system-kubernetes-dashboard-443] ipWhichEndsWith.249:8443 7 0.001 200
</code></pre>

<p>On my mind it is related with nginx redirection to upstream: "<a href="http://ipWhichEndsWith.249:8443/dashboard" rel="noreferrer">http://ipWhichEndsWith.249:8443/dashboard</a>" .
tried to update controller image version to 0.9.0-beta.19 - didnt help</p>

<p>Thank you for any help.</p>

<p>As you pointed out, looks like nginx is proxying your https request to <code>ipWhichEndsWith.249:8443</code>, which is an HTTPS endpoint, using <code>http</code> as protocol. </p>

<p>You should add the following annotation to your PodSpec:</p>

<blockquote>
  <p><strong>LATEST</strong></p>
  
  <p>This annotation was added to replace the deprecated annotation since 0.18.0</p>
  
  <p><a href="https://github.com/kubernetes/ingress-nginx/pull/2871" rel="noreferrer">#2871</a> Add support for AJP protocol</p>
</blockquote>

<pre><code>nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
</code></pre>

<hr>

<blockquote>
  <p><strong>DEPRECATED</strong> </p>
  
  <p>This annotation was deprecated in 0.18.0 and removed after the release of
  0.20.0</p>
  
  <p><a href="https://github.com/kubernetes/ingress-nginx/pull/3203" rel="noreferrer">#3203</a> Remove annotations grpc-backend and secure-backend already deprecated</p>
</blockquote>

<pre><code>nginx.ingress.kubernetes.io/secure-backends: "true"
</code></pre>

<hr>

<p>This should make nginx forward your request to the pods with https.</p>

<p>Source: <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#backend-protocol" rel="noreferrer">https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#backend-protocol</a></p>

<p>Docs: <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#backend-protocol" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#backend-protocol</a></p>
