Caddyfile 844 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #
  2. {
  3. debug
  4. skip_install_trust
  5. }
  6. {$SERVER_NAME:localhost} {
  7. # Enable compression (optional)
  8. encode zstd br gzip
  9. # Add trailing slash for directory requests
  10. @canonicalPath {
  11. file {path}/index.php
  12. not path */
  13. }
  14. redir @canonicalPath {path}/ 308
  15. @unapages path_regexp ^/page/(.*)$
  16. rewrite @unapages /page.php?i={re.unapages.1}
  17. @unamodules path_regexp ^/m/(.*)$
  18. rewrite @unamodules /modules/index.php?r={re.unamodules.1}
  19. @unastorage path_regexp ^/s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+)
  20. rewrite @unastorage /storage.php?o={re.unastorage.1}&f={re.unastorage.2}
  21. @unaMissing {
  22. not file
  23. not path */
  24. path_regexp una ^/(.+)$
  25. }
  26. rewrite @unaMissing /r.php?_q={re.una.1}&{query}
  27. try_files {path} {path}/index.php {path}/index.html
  28. # FrankenPHP!
  29. @phpFiles path *.php
  30. php @phpFiles
  31. file_server
  32. }