Caddyfile 541 B

12345678910111213141516171819202122232425262728293031323334
  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. # FrankenPHP!
  24. @phpFiles path *.php
  25. php @phpFiles
  26. encode zstd gzip
  27. file_server
  28. respond 404
  29. }
  30. }