Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save letunglam/c1deab66f0b95cf12577 to your computer and use it in GitHub Desktop.
Save letunglam/c1deab66f0b95cf12577 to your computer and use it in GitHub Desktop.

S3 Website "Index Document"

index.html:

<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

S3 Website "Error Document"

4xx.html:

<html>
<head>
<title>Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

S3 CORS Configuration

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>http://*.foo1.com</AllowedOrigin>
        <AllowedOrigin>http://*.foo2.com</AllowedOrigin>
        <AllowedOrigin>http://11.111.111.111</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>2592000</MaxAgeSeconds>
        <ExposeHeader>Content-Length</ExposeHeader>
        <ExposeHeader>Date</ExposeHeader>
        <ExposeHeader>ETag</ExposeHeader>
        <ExposeHeader>Connection</ExposeHeader>
        <AllowedHeader>Date</AllowedHeader>
        <AllowedHeader>Authorization</AllowedHeader>
        <AllowedHeader>Content-Type</AllowedHeader>
        <AllowedHeader>Content-Length</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

Transmit "Custom Amazon S3 Upload Headers"

Default:

  1. Cache-Control: max-age=86400 (1 day)

css:

  1. Content-Type: text/css
  2. Cache-Control: max-age=2592000 (30 days)

otf:

  1. Content-Type: font/opentype
  2. Cache-Control: max-age=31536000 (1 year)

woff:

  1. Content-Type: font/woff
  2. Cache-Control: max-age=31536000

ttf:

  1. Content-Type: font/truetype
  2. Cache-Control: max-age=31536000

svg:

  1. Content-Type: image/svg+xml
  2. Cache-Control: max-age=31536000

eot:

  1. Content-Type: application/vnd.ms-fontobject
  2. Cache-Control: max-age=31536000

html:

  1. Content-Type: text/html
  2. Cache-Control: max-age=86400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment