I have an AWS ALB configured in such a way that it should REDIRECT (302) requests to https://example.com/api/v1/* to another region. However, it turns out, that the REDIRECT functionality of hte AWS ALB is changing all http: methods (POST, PUT, ...) to GET - so on the target server, I only receive "GET" Requests.
Now I don't know whether this is
Can anyone help solve the puzzle ?
Select a load balancer, and then choose HTTP Listener. Under Rules, choose View/edit rules. Choose Edit Rule to modify the existing default rule to redirect all HTTP requests to HTTPS.
Classic Load Balancers can't redirect HTTP traffic to HTTPS by default. Instead, configure your rewrite rules for the web servers instances behind the Classic Load Balancer. You must configure your rewrite rules to use the X-Forwarded-Proto header and redirect only HTTP clients.
I think it is intended behaviour.
The issue you are experiencing is composed of the following:
Let me explain a little bit more in detail:
[1] https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#redirect-actions
[2] https://softwareengineering.stackexchange.com/questions/99894/why-doesnt-http-have-post-redirect
[3] What is the correct behavior expected of an HTTP POST => 302 redirect to GET?
[4] https://www.ietf.org/rfc/rfc2616.txt
[5] https://linux.die.net/man/1/curl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With