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,390 points
105 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 3,770 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
27 views
0 votes
1 answer

How do I write an S3 Object to a file?

While IOUtils.copy() and IOUtils.copyLarge() are great, I would prefer the old ...READ MORE

answered Jul 13, 2018 in AWS by Hammer
• 360 points
39 views
+13 votes
2 answers
+1 vote
2 answers

AWS CloudWatch Logs in Docker

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

answered Sep 6, 2018 in AWS by bug_seeker
• 14,960 points
229 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
• 3,770 points
140 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
• 3,770 points
34 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.