<p>When we use a &quot;simple fanout&quot; Ingress pattern, as described here: <a href="https://v1-18.docs.kubernetes.io/docs/concepts/services-networking/ingress/#simple-fanout" rel="nofollow noreferrer">https://v1-18.docs.kubernetes.io/docs/concepts/services-networking/ingress/#simple-fanout</a> (we're using v1.18), the Ingress performs a simple redirect, sending <code>302 - Found</code></p>
<p>This causes the HTTP method to change to GET.</p>
<p>I'm trying to get the Ingress to give either a 307 or a 308 response instead.</p>
<p>I've tried using NGINX/k8s annotations, and I've tried applying the sort of approach here: <a href="https://stackoverflow.com/questions/56177198/kubernetes-nginx-ingress-changes-http-request-from-a-post-to-a-get">Kubernetes NGINX Ingress changes HTTP request from a POST to a GET</a> but this doesn't work</p>
<p>We have 2 applications mapped to the same server using different ports behind the scenes.</p>
<p>Strangely enough, the POST is preserved fine with <code>curl</code></p>

pc3356
<p>In the end it's not really anything to do with K8S or NGINX:</p>
<p>The endpoint I wanted to use was mapped to &quot;/&quot; in the context (i.e. <code>/blah/</code>)</p>
<p>Since it's an API, it would be unusual to have something with a trailing slash, so I was referring to it by <code>/blah</code>, which the underlying application server rewrote to <code>/blah/</code> with a 302.</p>
<p>Fixed it by using <code>/v1</code> as the context (and ingress path), so I can have <code>/v1/blah</code> and it won't rewrite/redirect.</p>
