chore: dedicated Caddyfiles based on AIO container launch strategies

Determine the Caddy config file based on the `ENABLE_SUBPATH_BASED_ACCESS` environment variable.
This commit is contained in:
jamesgeorge007
2023-11-03 13:25:36 +05:30
parent aebcbac979
commit 79a9285f93
5 changed files with 52 additions and 49 deletions

View File

@@ -0,0 +1,33 @@
:3000 {
respond 404
}
:3100 {
respond 404
}
:8080 {
# Serve the `selfhost-web` SPA by default
root * /site/selfhost-web
file_server
handle_path /admin* {
root * /site/sh-admin-subpath-access
file_server
# Ensures any non-existent file in the server is routed to the SPA
try_files {path} /
}
# Handle requests under `/backend*` path
handle_path /backend* {
reverse_proxy localhost:3170
}
# Catch-all route for unknown paths, serves `selfhost-web` SPA
handle {
root * /site/selfhost-web
file_server
try_files {path} /
}
}