0

When we use a "simple fanout" Ingress pattern, as described here: https://v1-18.docs.kubernetes.io/docs/concepts/services-networking/ingress/#simple-fanout (we're using v1.18), the Ingress performs a simple redirect, sending 302 - Found

This causes the HTTP method to change to GET.

I'm trying to get the Ingress to give either a 307 or a 308 response instead.

I've tried using NGINX/k8s annotations, and I've tried applying the sort of approach here: Kubernetes NGINX Ingress changes HTTP request from a POST to a GET but this doesn't work

We have 2 applications mapped to the same server using different ports behind the scenes.

Strangely enough, the POST is preserved fine with curl

pc3356
  • 191
  • 1
  • 1
  • 6

1 Answers1

2

In the end it's not really anything to do with K8S or NGINX:

The endpoint I wanted to use was mapped to "/" in the context (i.e. /blah/)

Since it's an API, it would be unusual to have something with a trailing slash, so I was referring to it by /blah, which the underlying application server rewrote to /blah/ with a 302.

Fixed it by using /v1 as the context (and ingress path), so I can have /v1/blah and it won't rewrite/redirect.

pc3356
  • 191
  • 1
  • 1
  • 6