<p>I have set up the <code>Nginx-Ingress</code> controller as per the documentation (<a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">Installation guide</a>)and followed the steps using the example provided. When I try to access the service using the <code>curl</code> command, I am getting a <code>400</code>  Bad request. When I look at the logs of the <code>nginx-ingress</code> pod, I am not seeing any error. I have attached the logs for reference. I am finding difficult to troubleshoot the issue. Where </p>

<pre><code>fetch the pods from the nginx-ingress namespace
$ kubectl get po -n nginx-ingress
NAME                             READY   STATUS    RESTARTS   AGE
coffee-7c45f487fd-965dq          1/1     Running   0          46m
coffee-7c45f487fd-bncz5          1/1     Running   0          46m
nginx-ingress-7f4b784f79-7k4q6   1/1     Running   0          48m
tea-7769bdf646-g559m             1/1     Running   0          46m
tea-7769bdf646-hlr5j             1/1     Running   0          46m
tea-7769bdf646-p5hp8             1/1     Running   0          46m

making the request. I have set up the DNS record in the /etc/hosts file
$ curl -vv http://cafe.example.com/coffee
GET /coffee HTTP/1.1
&gt; Host: cafe.example.com
&gt; User-Agent: curl/7.61.1
&gt; Accept: */*
&gt;
&lt; HTTP/1.1 400 Bad Request
&lt; Server: nginx/1.17.10
&lt; Date: Mon, 11 May 2020 17:36:31 GMT
&lt; Content-Type: text/html
&lt; Content-Length: 158
&lt; Connection: close

checking the logs after the curl request
$ kubectl logs -n nginx-ingress nginx-ingress-7f 4b784f79-7k4q6

100.96.1.1 - - [11/May/2020:17:31:48 +0000] "PROXY TCP4 172.20.61.112 172.20.61.112 8340 32579" 400 158 "-" "-" "-"
100.96.1.1 - - [11/May/2020:17:31:51 +0000] "PROXY TCP4 172.20.81.142 172.20.81.142 40392 32579" 400 158 "-" "-" "-"
100.96.1.1 - - [11/May/2020:17:31:58 +0000] "PROXY TCP4 172.20.61.112 172.20.61.112 8348 32579" 400 158 "-" "-" "-"
100.96.1.1 - - [11/May/2020:17:32:01 +0000] "PROXY TCP4 172.20.81.142 172.20.81.142 40408 32579" 400 158 "-" "-" "-"
100.96.1.1 - - [11/May/2020:17:32:08 +0000] "PROXY TCP4 172.20.61.112 172.20.61.112 8360 32579" 400 158 "-" "-" "-"
100.96.1.1 - - [11/May/2020:17:32:11 +0000] "PROXY TCP4 172.20.81.142 172.20.81.142 40414 32579" 400 158 "-" "-" "-"
100.96.1.1 - - [11/May/2020:17:32:18 +0000] "PROXY TCP4 3.6.94.242 172.20.81.142 35790 80" 400 158 "-" "-" "-"
100.96.1.1 - - [11/May/2020:17:32:18 +0000] "PROXY TCP4 172.20.61.112 172.20.61.112 8366 32579" 400 158 "-" "-" "-"
100.96.1.1 - - [11/May/2020:17:32:21 +0000] "PROXY TCP4 172.20.81.142 172.20.81.142 40422 32579" 400 158 "-" "-" "-"
</code></pre>

zilcuanu
<p>I was able to resolve the issue after adding the following annotations.</p>
<pre><code>nginx.ingress.kubernetes.io/backend-protocol: HTTPS
nginx.ingress.kubernetes.io/ssl-redirect: true
nginx.ingress.kubernetes.io/force-ssl-redirect: true
</code></pre>
