mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
36 lines
543 B
Caddyfile
36 lines
543 B
Caddyfile
{
|
|
debug
|
|
frankenphp {
|
|
#worker ./index.php
|
|
}
|
|
}
|
|
|
|
http:// {
|
|
log
|
|
route {
|
|
root .
|
|
# Add trailing slash for directory requests
|
|
@canonicalPath {
|
|
file {path}/index.php
|
|
not path */
|
|
}
|
|
redir @canonicalPath {path}/ 308
|
|
|
|
# If the requested file does not exist, try index files
|
|
@indexFiles file {
|
|
try_files {path} {path}/index.php index.php
|
|
split_path .php
|
|
}
|
|
rewrite @indexFiles {http.matchers.file.relative}
|
|
|
|
encode zstd br gzip
|
|
|
|
# FrankenPHP!
|
|
@phpFiles path *.php
|
|
php @phpFiles
|
|
file_server
|
|
|
|
respond 404
|
|
}
|
|
}
|