Skip to content

Instantly share code, notes, and snippets.

@straight-shoota
Last active December 14, 2021 22:45
Show Gist options
  • Save straight-shoota/301dd22162846d044c89016f7cb2a1f3 to your computer and use it in GitHub Desktop.
Save straight-shoota/301dd22162846d044c89016f7cb2a1f3 to your computer and use it in GitHub Desktop.
Crystal S3 Config
{
"IndexDocument": {
"Suffix": "index.html"
},
"ErrorDocument": {
"Key": "api/1.2.2/404.html"
},
"RoutingRules": [
{
"Condition": {
"KeyPrefixEquals": "api/latest/1.2.2/"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "302",
"Protocol": "https",
"ReplaceKeyWith": "404"
}
},
{
"Condition": {
"KeyPrefixEquals": "api/latest/"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "302",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/1.2.2/"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/"
}
}
]
}
{
"IndexDocument": {
"Suffix": "index.html"
},
"ErrorDocument": {
"Key": "reference/404.html"
},
"RoutingRules": [
{
"Condition": {
"KeyPrefixEquals": "reference/installation"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "install"
}
},
{
"Condition": {
"KeyPrefixEquals": "reference/overview/hello_world.html"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/getting_started"
}
},
{
"Condition": {
"KeyPrefixEquals": "reference/overview"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/getting_started"
}
},
{
"Condition": {
"KeyPrefixEquals": "reference/latest/1.2/"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyWith": "404"
}
},
{
"Condition": {
"KeyPrefixEquals": "reference/latest"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "302",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/1.2/"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment