1. Caddy version (v2.4.0
):
d. My complete Caddyfile or JSON config:
caddyt.tamilchatz.com {
root * /www/wwwroot/caddytest/tamilchat/public
php_fastcgi unix//run/php/php8.0-fpm.sock
file_server
tls admin@tamilchatz.com {
protocols tls1.2 tls1.3
}
}
test.caddyt.tamilchatz.com {
file_server
route {
mercure {
transport_url local://local
publisher_jwt atestingjwtkeygoesinheres
subscriber_jwt atestingjwtkeygoesinheres
publish_origins *
cors_origins https://caddyt.tamilchatz.com
anonymous
subscriptions {
$MERCURE_EXTRA_DIRECTIVES
}
}
respond /healthz 200
respond "Not Found" 404
}
}
3. The problem I’m having:
In nginx i used to have this re-write code to make symfony application load using php. But through caddy, i have no idea how to do it. Help me out to sort this out.
Website gives “500 Error”, check here >> https://caddyt.tamilchatz.com
Here is the NGINX code i use.
try_files $uri @rewriteapp;
location @rewriteapp {
rewrite ^(.*)$ /index.php/$1 last;
}
rewrite ^/index.php?(.*)$ /$1 permanent;
5. What I already tried:
I have tried this code
rewrite { to {path} {path}/ /index.php/{path} }
But i end up getting this error while starting caddy.
run: adapting config using caddyfile: parsing caddyfile tokens for 'rewrite': /etc/caddy/Caddyfile:4 - Error during parsing: Wrong argument count or unexpected line ending after 'rewrite'