title: How to configure AWS S3 to allow POST to work like GET
body: <p>Facebook states in their canvas setup documentation:</p>
  
  <blockquote>
    <p>Our servers will make an HTTP POST request to this web address. The
    retrieved result will be displayed within the Canvas frame on
    Facebook.</p>
  </blockquote>
  
  <p>My application is hosted on AWS S3 as a static website using the following CORS configuration:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt;
      &lt;CORSRule&gt;
          &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
          &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;POST&lt;/AllowedMethod&gt;
          &lt;AllowedMethod&gt;HEAD&lt;/AllowedMethod&gt;
          &lt;MaxAgeSeconds&gt;3000&lt;/MaxAgeSeconds&gt;
          &lt;AllowedHeader&gt;Authorization&lt;/AllowedHeader&gt;
      &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  
  <p>Already I'm having an issue here. <code>GET</code> requests work perfectly, but <code>POST</code>ing to <a href="http://my-bucket-name.s3-website-us-east-1.amazonaws.com" rel="nofollow noreferrer">http://my-bucket-name.s3-website-us-east-1.amazonaws.com</a> kicks back:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;405 Method Not Allowed&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;405 Method Not Allowed&lt;/h1&gt;
          &lt;ul&gt;
              &lt;li&gt;Code: MethodNotAllowed&lt;/li&gt;
              &lt;li&gt;Message: The specified method is not allowed against this resource.&lt;/li&gt;
              &lt;li&gt;Method: POST&lt;/li&gt;
              &lt;li&gt;ResourceType: OBJECT&lt;/li&gt;
              &lt;li&gt;RequestId: 94159551A72424C7&lt;/li&gt;
              &lt;li&gt;HostId: +Lcz+XaAzL97Y47OZFvaTwqz4Z7r5koaJGHjZJBBMOTUHyThTfKbZG6IxJtYEbtsXWcb/bFxeI8=&lt;/li&gt;
          &lt;/ul&gt;
          &lt;hr/&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Step 1: ^ I think I need to get this this working.</p>
  
  <p><strong>but wait, there's more</strong></p>
  
  <p>Facebook also requires a <strong>secure</strong> url. so for this, I went to cloudfront.</p>
  
  <p>My configuration looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/1xBHQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1xBHQ.png" alt="Cloudfront Configuration"></a></p>
  
  <p><a href="https://i.stack.imgur.com/FzrOb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FzrOb.png" alt="More Cloudfront Configuration"></a></p>
  
  <p>Just like when working with S3 directly, making <code>GET</code> requests to <a href="https://app-cloudfront-id.cloudfront.net/" rel="nofollow noreferrer">https://app-cloudfront-id.cloudfront.net/</a> works like a champ, POSTing, kicks back this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Error&gt;
      &lt;Code&gt;MethodNotAllowed&lt;/Code&gt;
      &lt;Message&gt;The specified method is not allowed against this resource.&lt;/Message&gt;
      &lt;Method&gt;POST&lt;/Method&gt;
      &lt;ResourceType&gt;OBJECT&lt;/ResourceType&gt;
      &lt;RequestId&gt;657E87A80AFBB3B0&lt;/RequestId&gt;
      &lt;HostId&gt;SY2g4smvhr06kAAQYVMsYeQZ+pSKbIIvsh/OaPBiMADGt5UKut0sXSZkFsnFmcRXQ2PFBVgPK4M=&lt;/HostId&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>Viewing the app on facebook.com shows:</p>
  
  <p><a href="https://i.stack.imgur.com/gsZTD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gsZTD.png" alt="app on facebook"></a></p>
  
  <p><strong>Am I missing something?</strong></p>