caddy v2 config : https://binbash.fr/topic/306/une-page-de-maintenance-pour-ingress-k8s-avec-caddy-v2
{ | |
"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