Forge, NGINX and Kirby CMS
I'm a big fan of Laravel Forge for provisioning servers.
Generally setting up a Kirby site is very straight forward, especially on Apache, but with default Forge setup (and Nginx) there are two small things that has tripped me up a few times already. That's why I make these notes for myself.
Disable Go helper function in Kirby
(because of a conflict with Swooles Go function)
# index.php
<?php
// Add in the line below
define('KIRBY_HELPER_GO', false);
require __DIR__ . '/kirby/bootstrap.php';
echo (new Kirby)->render();
Nginx config changes
On the site at hand, click the dropdown "edit files" and further "Edit Nginx configuration". Add the two following lines before the location
…
rewrite ^\/(content|site|kirby)/(.*)$ /error last;
rewrite ^\/\.(?!well-known\/) /error last;
// and it continues like normal…
location / {………