0

I'm attempting to set up a path rewriting ingress to my backend service using the following:

I've deployed my service and the ingress controller using Helm. When I describe the Ingress resource, it looks exactly like this example, but with a few extra labels from Helm.

When I attempt to GET or POST to any resource (existing or not) that matches the regex using curl (using a path starting with /something), I get a HTTP 400 response. Logging on my backend service shows that it never received the request. When I attempt to hit any other nonexistent path, I get a HTTP 404 from nginx, which is expected.

How do I resolve the HTTP 400s and get nginx to forward the traffic to my service? I'm guessing there's something missing from either my nginx config or from the ingress controller config, but I don't see anything obvious in the docs.

Mark
  • 4,970
  • 5
  • 42
  • 66

1 Answers1

1

Try these troubleshooting steps which will help you to resolve your issue.

1.Check whether your ingress controller has configured to respect the proxy protocol settings in the LB

2.Check if you added the proxy protocol directive to your configmap.

3.If the issue is still not resolved then you need to add extra args to the config map as below:

extraArgs:
  # - --enable-skip-login
  - --enable-insecure-login
  # - --system-banner="Welcome to Kubernetes"

Attaching the Git Issue which addresses a similar issue.

Sai Chandini Routhu
  • 750
  • 1
  • 3
  • 13
  • Thanks for pointing me to this. I was able to turn up logging to nginx debug (v=5) using this part of the docs: https://kubernetes.github.io/ingress-nginx/troubleshooting/#debug-logging. Once I did that, I was able to see the exact request with headers that nginx was making to my backend service. The framework that my backend service uses appears to have an issue with handling the `X-Forwarded-Host` header that nginx adds. – Mark Mar 10 '23 at 22:44