title: Setting CORS config for AWS S3
body: <p>To optimize my server usage I moved the images (~500) and rendered <code>HTML</code> files for <code>SEO</code> (~1000) to <code>S3</code> storage &amp; it works just fine, however, I am worried about having a <code>DDoS</code> attack which will, in the end, cost me a lot of money, since Amazon charges for every <code>GET</code> request.</p>
  
  <p>I did some research on how to prevent that and found out that there is a <code>CORS</code> config option for <code>S3</code>.   </p>
  
  <p>I tried it out, but unfortunately, it didn't seem to work. Can still access the files from any <code>URL</code></p>
  
  <p><a href="https://i.stack.imgur.com/VmEs0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VmEs0.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/UskdF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UskdF.jpg" alt="enter image description here"></a></p>
  
  <p>What am I doing wrong?</p>
  
  <p>UPDATE:</p>
  
  <p>Also tried to set bucket policy:</p>
  
  <p><a href="https://i.stack.imgur.com/ymkKQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ymkKQ.jpg" alt="enter image description here"></a></p>