BookStack Setup

I’m trying to get BookStack setup on my DO droplet, and it’s mostly running. But I’m not sure the rewrite rule is working as needed because putting in just the domain name gives me a 404 error, and manually adding /index.php redirects to /index.php/login, but all the images and the layout inside appear broken or missing. Has anyone successfully setup BookStack on Caddy? Below is my location block: {
        root    /var/www/
        log     /var/log/caddy/access.log
        errors  /var/log/caddy/errors.log

        fastcgi / /var/run/php/php7.0-fpm.sock {
                ext     .php
                split   .php
                index   doku.php

        rewrite / {
                to {path} {path}/ /index.php?{query}


The installation documentation says:


Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]


location / {
    try_files $uri $uri/ /index.php?$query_string;

Is the index file actually called doku.php?

A request to / will rewrite successfully to {path} (as it’s a valid folder), sent to the FastCGI socket, where php will attempt to render /doku.php as the index file (as opposed to index.php, which is what the rewrite and the other web server configurations seem to be using).

If it’s not actually doku.php, try changing your fastcgi to:

fastcgi / /var/run/php/php7.0-fpm.sock php

If the index file is in fact doku.php, try changing your rewrite:

rewrite {
  to {path} {path}/ /doku.php?{query}

And there it is, the tired and overlooked obvious piece. That’s what I get for copying another block instead of typing it out. Thank you @Whitestrake!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.