Converting nginx's try_files to caddy

Your config should just look like this:

onix.minjae.dev {
	root * /var/www/pterodactyl/public
	encode gzip
	php_fastcgi unix//run/php/php8.1-fpm.sock
	file_server
}

That’s all you need. Caddy’s php_fastcgi directive has built-in try_files, and it should work just fine out of the box in your case.

2 Likes