Files
hoppscotch/aio.Caddyfile
jamesgeorge007 03e21e0b0c fix: ensure any non-existent file in the server is routed to the corresponding SPA
try_files avoids 404s, redirecting to SPA root; catch-all handles unknown paths for selfhost-web.
2023-11-10 12:51:35 +05:30

27 lines
611 B
Caddyfile

:3000 {
# Serve the `selfhost-web` SPA by default
root * /site/selfhost-web
file_server
# Handle requests under `/admin*`
handle_path /admin* {
root * /site/sh-admin
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} /
}
}