From f84b320cad6b780e3114905e7b9e77ce33c9862d Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 16 Nov 2023 16:49:49 +0100 Subject: [PATCH] fix(caddy): use index.html --- api/docker/caddy/Caddyfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/docker/caddy/Caddyfile b/api/docker/caddy/Caddyfile index f6ac9fb1..2207a79b 100644 --- a/api/docker/caddy/Caddyfile +++ b/api/docker/caddy/Caddyfile @@ -17,6 +17,10 @@ redir @defaultdocs /docs/3.2/distribution{1} @version path_regexp version (/docs/[^/]+)$ redir @version {re.version.1}/distribution +@withoutExtension not path_regexp \.\w+$ +@withTld path_regexp \.(org|io|fr|com|pl|me|de|gg|dev)$ +@withTrailingSlash path_regexp ^(.*)/+$ + handle_path /docs/* { # you could ADD ./docs /srv/app/docs and use this for development # root * /srv/app/docs @@ -26,6 +30,11 @@ handle_path /docs/* { header_up Host {http.reverse_proxy.upstream.hostport} } + # Handles DocumentIndices + rewrite @withTld /{$BUCKET_S3_NAME}{path}/index.html + rewrite @withTrailingSlash /{$BUCKET_S3_NAME}{path}index.html + rewrite @withoutExtension /{$BUCKET_S3_NAME}{path}/index.html + rewrite * /{$BUCKET_S3_NAME}{path} }