500 internal server error

Hi,

my kirby rewrite rules for nginx are

if (!-e $request_filename){
  rewrite ^/kirby/panel/(.*) /kirby/panel/index.php break;
}

if (!-e $request_filename) {
  rewrite ^/kirby/(.*)$ /kirby/index.php last;
  break;
}

Everything works but the panel login.

Changing to

if (!-e $request_filename){
  rewrite ^/kirby/panel/(.*) /kirby/panel/index.php last;
  break;
}

if (!-e $request_filename) {
  rewrite ^/kirby/(.*)$ /kirby/index.php last;
  break;
}

results in being able to use the panel but then everything else breaks.

But when I am logged in and then change the rewrite rules to the first version it works everywhere.

Please enlighten me. I love kirby :sunny:

I don’t have much experience with Nginx, so I can’t really tell why it doesn’t work.

Please try Bastian’s example configuration. Maybe that works for you.