mirror of
https://github.com/dunglas/frankenphp
synced 2024-10-16 17:14:59 +00:00
7ec0043fe8
* feat: handle errors in worker mode (not working) * feat: better exception and error handling
35 lines
543 B
Caddyfile
35 lines
543 B
Caddyfile
{
|
|
debug
|
|
frankenphp {
|
|
worker ./error.php
|
|
}
|
|
}
|
|
|
|
localhost {
|
|
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}
|
|
|
|
# FrankenPHP!
|
|
@phpFiles path *.php
|
|
php @phpFiles
|
|
encode zstd gzip
|
|
file_server
|
|
|
|
respond 404
|
|
}
|
|
}
|