Caddyfile 545 B

1234567891011121314151617181920212223242526272829303132333435
  1. {
  2. debug
  3. frankenphp {
  4. #worker ./index.php
  5. }
  6. }
  7. http:// {
  8. log
  9. route {
  10. root * .
  11. # Add trailing slash for directory requests
  12. @canonicalPath {
  13. file {path}/index.php
  14. not path */
  15. }
  16. redir @canonicalPath {path}/ 308
  17. # If the requested file does not exist, try index files
  18. @indexFiles file {
  19. try_files {path} {path}/index.php index.php
  20. split_path .php
  21. }
  22. rewrite @indexFiles {http.matchers.file.relative}
  23. encode zstd br gzip
  24. # FrankenPHP!
  25. @phpFiles path *.php
  26. php @phpFiles
  27. file_server
  28. respond 404
  29. }
  30. }