Kirby requires Apache, Nginx or Caddy - even though it is

Testing site against a (test) subdomain to see different server setups other than localhost to see if several of my functions still work on another envoirment i am running into the problem, that when trying to access the panel it shows the

Kirby requires Apache, Nginx or Caddy

error message, even though the server is running

  • apache
  • nginx (reverse proxy)

are there some cases where the actual server can’t be read, and there is, what would be a possible fix?
(or at least a way to identify to what could be the issue)

Ok, found some github link to check the

var_dump($_SERVER['SERVER_SOFTWARE']);

it seems that my mod_security setting is overwriting this variable because the result is nowhere near “Apache” or “nginx” but hinting at mod security…

Could i just add

        $servers = [
            'apache',
            'caddy',
            'litespeed',
            'nginx',
            'php',
             // Addition below
            'mod security'
        ];

or would that be a rather bad idea (server_software echoes a string with mod security) and adding that, seems to work…

Instead of hacking the core you could try to overwrite the server software in the index.php before Kirby gets initialized.

$_SERVER['SERVER_SOFTWARE'] = 'apache';

We already have a ticket to disable that check or overwrite it, so this might just be a temporary hack.