I want Caddy to display my index page when I GET /.
In other words, when I go to caddyexample.com, I want to see my index.php. Currently, I get a bad gateway.
show what you have already tried
I have tried setting index to index.php in /etc/caddy/Caddyfile.
P.S. I note that ext and index are essentially without function for your setup - a request for a PHP file or an index will always be handled by fastcgi, which will serve the client without regard to whatever you set those to.
Yes. Due to the ext parameter, when I go to an actual page such as producten, the page gets loaded just fine. When I visit a non-existent page, I get a 404 from Caddy.
P.S. I note that ext and index are essentially without function for your setup - a request for a PHP file or an index will always be handled by fastcgi , which will serve the client without regard to whatever you set those to.
ext is not without function. It does make a difference and does what the documentation says it does.
whitestrake at apollo in ~/Projects/test
❯ cat index.php
<?php echo("This is the PHP index file.") ?>
whitestrake at apollo in ~/Projects/test
❯ cat foo.php
<?php echo("This is the PHP foo file.") ?>
whitestrake at apollo in ~/Projects/test
❯ curl http://localhost:2015/
This is the PHP index file.⏎
whitestrake at apollo in ~/Projects/test
❯ curl http://localhost:2015/foo
This is the PHP foo file.⏎