Hi guys,
I would like a hand and some more savvy minds to verify that I’ve got the correct setup for my Caddyfile.
I want to work with the headless CMS Directus using Caddy.
Based on the nginx conf that comes supplied with Directus I have put together the following:
http://localhost
fastcgi / 127.0.0.1:9000 php
rewrite /api {
to {path} {path}/ /api/api.php?run_api_router=1
}
rewrite {
to {path} {path}/ /index.php?{query}
}
It kinda works but obviously I’ve skipped a whole bunch of directives. I would like to make it more complete obviously.
It is based off of the following nginx conf lines:
location /api {
if (!-e $request_filename) {
rewrite ^/1/extensions/([^/]+) /api/api.php?run_extension=$1 last;
}
rewrite ^ /api/api.php?run_api_router=1 last;
}
location / {
try_files $uri $uri/ /index.php$args;
}
For complete clarity, there is also an htaccess file.
I appreciate any help. If we arrive at a complete solution, I’ll be adding this to the caddyserver/examples repo.