$ vi index.html
<!DOCTYPE html>
<html>
<body>
<h1>This is origin page.</h1>
</body>
<div id="fetchedcontent"/>
<script>
var fetchedcontent = document.getElementById("fetchedcontent");
fetch('https://cross-origin.kr-website.cafe24obs.com/cors.html')
.then((response) => {
return response.text();
})
.then((html) => {
fetchedcontent.innerHTML = html
});
</script>
</html>
$ s3cmd put index.html s3://origin --acl-public
upload: 'index.html' -> 's3://origin/index.html' [1 of 1]
527 of 527 100% in 0s 8.78 KB/s done
Public URL of the object is: http://kr.cafe24obs.com/origin/index.html
$ vi cors.html
<b>This is from cross-origin page.</b>
$ s3cmd put cors.html s3://cross-origin --acl-public
upload: 'cors.html' -> 's3://cross-origin/cors.html' [1 of 1]
39 of 39 100% in 0s 695.60 B/s done
Public URL of the object is: http://kr.cafe24obs.com/cross-origin/cors.html
$ vi corsrules.xml
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>https://origin.kr-website.cafe24obs.com</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>