1. The problem I’m having:
I’m attempting to set up Bookstack, using Caddy as the webserver. I’m running everything on a Debian container hosted on Proxmox.
Bookstack works as expected, as I’ve installed Apache2 to check and deployed the example config from Bookstack (link below in chapter 5). They also provide an example NGINX config (link below in chapter 5).
I’ve based my Caddyfile, based on a post on this community (link below in chapter 5).
If I attempt to access Bookstack, the HTTPS connection is established and the response is HTTP 200 OK, but it’s empty (content-length: 0).
I suspect there’s an issue with either the rewrite or php_fastcgi directive. This is my first Caddy setup - so I’m not sure how to approach this.
I can access the plain HTTP (port 80) page without a problem, the default index.html
is shown.
2. Error messages and/or full log output:
curl -vL https://sage.local.maryctrl.de
* Host sage.local.maryctrl.de:443 was resolved.
* IPv6: (none)
* IPv4: 192.168.178.204
* Trying 192.168.178.204:443...
* Connected to sage.local.maryctrl.de (192.168.178.204) port 443
* schannel: disabled automatic use of client certificate
* ALPN: curl offers http/1.1
* ALPN: server accepted http/1.1
* using HTTP/1.x
> GET / HTTP/1.1
> Host: sage.local.maryctrl.de
> User-Agent: curl/8.7.1
> Accept: */*
>
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
< HTTP/1.1 200 OK
< Alt-Svc: h3=":443"; ma=2592000
< Server: Caddy
< Date: Sun, 04 Aug 2024 18:25:35 GMT
< Content-Length: 0
<
I can’t see anything pop up under /var/log/caddy/bookstack.log
, when I attempt the access.
3. Caddy version:
Caddy version: 2.6.2
4. How I installed and ran Caddy:
Installed from the Debian Bookworm repository: sudo apt install caddy
a. System environment:
Debian GNU/Linux 12 (bookworm), Kernel: #1 SMP PREEMPT_DYNAMIC PMX 6.5.11-8 (2024-01-30T12:27Z)
b. Command:
I run Caddy as the webserver, so I assume the systemd service is relevant
sudo service caddy start
c. Service/unit/compose file:
d. My complete Caddy config:
:80 {
root * /usr/share/caddy
file_server
}
https://sage.local.maryctrl.de {
root * /var/www/BookStack/public
encode gzip
tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/privkey.pem
log {
output file /var/log/caddy/bookstack.log
}
# The commented blocks are alternatives I tried with the same result
php_fastcgi / /var/run/php/php8.2-fpm.sock {
root /var/www/BookStack/public
index index.php
}
#php_fastcgi unix//run/php/php8.2-fpm.sock
rewrite * index.php?{query}
#try_files * /index.php?{query}
}
5. Links to relevant resources:
- Apache Example Config for Bookstack: devops/config/apache/bookstack.conf at main - bookstack/devops - Codeberg.org
- NGINX Example Config for Bookstack: devops/config/nginx/ubuntu-1604-install-config at main - bookstack/devops - Codeberg.org
- Community post I based my config on: BookStack Setup