aio-subpath-access.Caddyfile 632 B

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