Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@oprypin
Forked from straight-shoota/S3 config api
Last active December 14, 2021 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oprypin/9c04999a9d94dce50c9c545a4bca892e to your computer and use it in GitHub Desktop.
Save oprypin/9c04999a9d94dce50c9c545a4bca892e 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/"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "302",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/1.2.2/"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/A"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/A"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/B"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/B"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/C"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/C"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/D"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/D"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/E"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/E"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/F"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/F"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/G"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/G"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/H"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/H"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/I"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/I"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/J"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/J"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/K"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/K"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/L"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/L"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/M"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/M"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/N"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/N"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/O"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/O"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/P"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/P"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/Q"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/Q"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/R"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/R"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/S"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/S"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/T"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/T"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/U"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/U"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/V"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/V"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/W"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/W"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/X"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/X"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/Y"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/Y"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/Z"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/Z"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "api/toplevel"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "api/latest/toplevel"
}
}
]
}
{
"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/latest/"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "302",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/1.2/"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/a"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/a"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/b"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/b"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/c"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/c"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/d"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/d"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/e"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/e"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/f"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/f"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/g"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/g"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/h"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/h"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/i"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/i"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/j"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/j"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/k"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/k"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/l"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/l"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/n"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/n"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/o"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/o"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/p"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/p"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/q"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/q"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/r"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/r"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/s"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/s"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/t"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/t"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/u"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/u"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/v"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/v"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/w"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/w"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/x"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/x"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/y"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/y"
}
},
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404",
"KeyPrefixEquals": "reference/z"
},
"Redirect": {
"HostName": "crystal-lang.org",
"HttpRedirectCode": "301",
"Protocol": "https",
"ReplaceKeyPrefixWith": "reference/latest/z"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment