I have a webpage hosted on Amazon S3 but I don't want the http response code to be 200
. The page is a maintenance page that I'll redirect traffic to when I take our main website down for maintenance.
I want the Amazon S3 page to include a response header of:
HTTP/1.1 503 Service unavailable
Amazon give the ability to add some metadata to the S3 Object but there is nothing for the http status code.
Is it possible?
To directly edit a file on S3, use edit subcommand. Then, open a file with the default editor specified by $EDITOR .
First, sign in to the AWS Management Console and navigate to Amazon S3. In the Buckets menu, select the bucket with the object ACLs you would like to modify. In the Objects tab, select an object to update. Select the Permissions tab to view the current ACL for the object.
HTTP 200 code indicates a successful write to S3.
Amazon S3 website endpoints do not support HTTPS or access points. If you want to use HTTPS, you can use Amazon CloudFront to serve a static website hosted on Amazon S3.
Not sure which browsers, or crawlers, that supports this. But you could potentially use the meta http-equiv status meta tag to accomplish this.
<meta http-equiv="status" content="503 Service Unavailable" />
The specification says to treat it in the same way as if 503 had been sent as the status code.
You cannot customize the status code for S3 responses.
You can use API Gateway as a proxy to your S3 website error page where you can customize status codes returned.
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