- Newest
- Most votes
- Most comments
Origin failover with POST or PUT method is not native or OOTB feature but with Lambda@edge you can do a workaround for the same. Essentially , here are the steps involved :
-
You can redirect ( HTTP 307) the response to same URL when using HTTP POST/PUT using Origin response Lambda code based on error code from Primary Origin when the Primary origin goes down. While redirecting , you can set up a set-cookie header with value as error=error code.
-
The subsequent POST/PUT request would hence contain a cookie with value set as "error=error code" parsed and detected by an Origin Request Lambda Function to dynamically change the Primary Origin to Failover Origin returning a success .
-
The browser stores the cookie for the Max-Age header value until which it returns the response from the Failover Origin ,however, after Max-Age value expires , it will initiate a request without the cookie and hence the response would be returned from Primary Origin if it is back otherwise the 307 will follow with above steps once again.
You can create a ticket with AWS for more details .
Relevant content
- asked 2 years ago
- asked 5 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 months ago
Looks like this will need a more comphrensive approach ..I have created a support case - 171991574000499 .Can we discuss there ?