1. The problem I’m having:
I’ve been running Caddy for over a year on a Rasberry Pi. The SD card crashed so I created a new one from a backup. Besides Caddy I’m also running PiVPN and PiHole and they both work. I don’t have a web server; I’m using it for access to Emby on another device. But it seems my Caddyfile has gone stale. Caddy Server won’t start and I can’t validate the Caddyfile.
2. Error messages and/or full log output:
caddy validate --config /etc/caddy/Caddyfile
2023/10/06 20:03:46.942 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": ""}
Error: adapting config using caddyfile: parsing caddyfile tokens for 'log': /etc/caddy/Caddyfile:13 - Error during parsing: Wrong argument count or unexpected line ending after 'true', import chain: ['']
Also
sudo systemctl status caddy
● caddy.service - caddy
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-10-06 17:06:24 EDT; 4s ago
Process: 26598 ExecStart=/home/pi/.local/bin/caddy run --config /etc/caddy/Caddyfile (code=exited, status=1/FAILURE)
Main PID: 26598 (code=exited, status=1/FAILURE)
Oct 06 17:06:24 raspberrypi systemd[1]: caddy.service: Service RestartSec=100ms expired, scheduling restart.
Oct 06 17:06:24 raspberrypi systemd[1]: caddy.service: Scheduled restart job, restart counter is at 3.
Oct 06 17:06:24 raspberrypi systemd[1]: Stopped caddy.
Oct 06 17:06:24 raspberrypi systemd[1]: caddy.service: Start request repeated too quickly.
Oct 06 17:06:24 raspberrypi systemd[1]: caddy.service: Failed with result 'exit-code'.
Oct 06 17:06:24 raspberrypi systemd[1]: Failed to start caddy.
3. Caddy version:
v2.7.4 h1:J8nisjdOxnYHXlorUKXY75Gr6iBfudfoGhrJ8t7/flI=
4. How I installed and ran Caddy:
curl -sS https://webinstall.dev/caddy | bash
later
caddy upgrade
To start
sudo systemctl start caddy
a. System environment:
Raspberry Pi 4b
Raspbian
5.10.103-v7+
b. Command:
curl ckran.noip.me
c. Service/unit/compose file:
Running native.
d. My complete Caddy config:
ckran.noip.me {
encode gzip
log {
output file /var/log/caddy/emby_access.log {
roll true # Rotate logs, enabled by default
roll_size_mb 5 # Set max size 5 MB
roll_gzip true # Compress files
roll_local_time true # use localhost time
roll_keep 2 # Keep at most 2 log files
roll_keep_days 7 # Keep log files for 7 days
}
}
reverse_proxy 192.168.1.37:8096
}
192.168.1.8 {
reverse_proxy 192.168.1.8 /* :480 */
}
http://pi.hole {
reverse_proxy 192.168.1.8 /* :480 */
}