Skip to content

Commit

Permalink
fix(caddy): use index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Nov 16, 2023
1 parent ab29725 commit f84b320
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/docker/caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
}

Expand Down

0 comments on commit f84b320

Please sign in to comment.