aio-subpath-access.Caddyfile 570 B

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