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)

# config.php

<?php

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;

location / {………

Links to Kirby docs on the topics:

Nginx boilerplate config
Deactivating Kirby helpers