aio-subpath-access.Caddyfile 594 B

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