aio-subpath-access.Caddyfile 553 B

123456789101112131415161718192021222324252627282930313233
  1. :3000 {
  2. respond 404
  3. }
  4. :3100 {
  5. respond 404
  6. }
  7. :80 {
  8. # Serve the `selfhost-web` SPA by default
  9. root * /site/selfhost-web
  10. file_server
  11. handle_path /admin* {
  12. root * /site/sh-admin-subpath-access
  13. file_server
  14. # Ensures any non-existent file in the server is routed to the SPA
  15. try_files {path} /
  16. }
  17. # Handle requests under `/backend*` path
  18. handle_path /backend* {
  19. reverse_proxy localhost:8080
  20. }
  21. # Catch-all route for unknown paths, serves `selfhost-web` SPA
  22. handle {
  23. root * /site/selfhost-web
  24. file_server
  25. try_files {path} /
  26. }
  27. }