I have set up the Nginx-Ingress
controller as per the documentation (Installation guide)and followed the steps using the example provided. When I try to access the service using the curl
command, I am getting a 400
Bad request. When I look at the logs of the nginx-ingress
pod, I am not seeing any error. I have attached the logs for reference. I am finding difficult to troubleshoot the issue. Where
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
> Host: cafe.example.com
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< Server: nginx/1.17.10
< Date: Mon, 11 May 2020 17:36:31 GMT
< Content-Type: text/html
< Content-Length: 158
< 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 "-" "-" "-"