Skip to content

Instantly share code, notes, and snippets.

@binbashfr

binbashfr/caddy.json

Last active Dec 11, 2020
Embed
What would you like to do?
{
"admin": {
"listen": ":2019"
},
"apps": {
"http": {
"servers": {
"maintenance": {
"listen": [
":80"
],
"routes": [
{
"match": [
{
"path": [
"/reason"
]
}
],
"handle": [
{
"handler": "static_response",
"body": ""
}
],
"terminal": true
},
{
"match": [
{
"path_regexp": {
"name": "maintenance",
"pattern": "^(/(?:css|js|img).*)"
}
}
],
"handle": [
{
"handler": "rewrite",
"uri": "/maintenance{http.regexp.maintenance.1}"
}
]
},
{
"match": [
{
"path_regexp": {
"name": "index",
"pattern": "^/(?:|index\\.html)$"
}
}
],
"handle": [
{
"handler": "rewrite",
"uri": "/maintenance/index.html"
}
]
},
{
"match": [
{
"not": [{
"path": [
"/maintenance/css*",
"/maintenance/js*",
"/maintenance/img*",
"/maintenance/",
"/maintenance/index.html"
]
}]
}
],
"handle": [
{
"handler": "rewrite",
"uri": "/maintenance/index.html"
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"transport": {
"protocol": "http",
"tls": {
"insecure_skip_verify": true,
"server_name": "minio"
}
},
"upstreams": [
{
"dial": "1.2.3.4:443"
}
],
"headers": {
"request": {
"add": {
"host": [
"minio"
]
}
}
}
}
]
}
]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment