POST request to S3 is returning a HTTPResponse 405

0 votes

I have the following CORS configuration for S3 in order to use one of my buckets as a static website hosting:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
    </CORSRule>
</CORSConfiguration>

Then I have the following Edit Redirection Rules:

<RoutingRules>
    <RoutingRule>
    <Condition>
        <KeyPrefixEquals>abc</KeyPrefixEquals>
    </Condition>
    <Redirect>
        <HostName>myec2instance.com</HostName>
    </Redirect>
</RoutingRule>
I want S3 to redirect the request when it receives a request of POST operation. The redirection rule is working properly but for some reason S3 is returning HTTPResponse 405 when the request is a POST. Any ideas why?
Aug 13, 2018 in AWS by datageek
• 2,540 points
5,325 views

1 answer to this question.

0 votes

This error has nothing to do with CORS -- it's S3 related error. The S3 website endpoints are only equipped for GET and HEAD. Anything else should be denied before the redirection rules are checked.

You can refer to the below link for more info on GET and HEAD objects.

 http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html

answered Aug 13, 2018 by Archana
• 4,170 points

Related Questions In AWS

+1 vote
4 answers

Can a URL be directly uploaded to S3 using POST?

You can read this blog and get ...READ MORE

answered Oct 25, 2018 in AWS by chamunda
3,285 views
0 votes
1 answer
+2 votes
1 answer

If s3 is global then why we need to select a region while launching it?

This might help you with your query.  Have ...READ MORE

answered Feb 18, 2020 in AWS by Sirajul
• 59,230 points
1,679 views
0 votes
0 answers
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 views
+1 vote
2 answers

AWS CloudWatch Logs in Docker

The awslogs works without using ECS. you need to configure ...READ MORE

answered Sep 7, 2018 in AWS by bug_seeker
• 15,510 points
2,032 views
0 votes
1 answer

Is it possible to find all S3 buckets given a prefix?

The high level collection command s3.buckets.filter only ...READ MORE

answered Aug 27, 2018 in AWS by Archana
• 4,170 points
6,627 views
0 votes
1 answer

How to upload a file to Amazon S3 without passing it my server?

This article pretty much explains the entire ...READ MORE

answered Aug 14, 2018 in AWS by Archana
• 4,170 points
3,266 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP