-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP method is not preserved with redirect #1772
Comments
I added the configuration snippet and it was added successfully but the snippets gets added to the end of the server section and so the default 301 redirect is being picked up first and the new configuration is not working as expected. |
@rothgar I think we could change 301 with 308. https://developer.mozilla.org/es/docs/Web/HTTP/Status/308 Edit: or add a configuration option with a default |
Simply changing 301 to 308 worked for the app I was testing. I didn't try all my other apps but this was a much easier change than expected. |
I'm still seeing this issue. I'm using image "quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.18.0" with pretty vanilla setup. I tried adding a configuration snippet to the ingress rule and that was not working. @rothgar could you tell me a bit more on how you got it to work? |
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.):
What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
NGINX Ingress controller version:
gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.15
Kubernetes version (use
kubectl version
):1.5.7
Environment:
What happened:
If a client redirects with a POST request to one of the ingress rules the ingress controller will provide a 301 redirect which changes POST to GET on the pod. A 307 redirect should be used instead to preserve the method.
What you expected to happen:
POST requests should be redirected as POST requests.
How to reproduce it (as minimally and precisely as possible):
Create an ingress rule and
curl -X POST
to the endpoint.You'll get a 301 redirect to the backend and your POST will turn into a GET in the pod.
Anything else we need to know:
I was able to manually fix this by adding this snippet to my ingress rule
This may not be the best way to make this work but it is the work around we found to make POST methods work.
We can probably do this with a configuration-snippet annotation but haven't tried yet.
The text was updated successfully, but these errors were encountered: