1. Caddy version (caddy version
):
2.2.1
2. How I run Caddy:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
a. System environment:
CentOS 7
b. Command:
sudo systemctl start caddy
or alternately:
caddy start
c. Service/unit/compose file:
paste full file contents here
d. My complete Caddyfile or JSON config:
http:// {
tls off
file_server {
root /etc/hyperglass/static/ui
index /etc/hyperglass/static/ui/index.html
}
file_server /custom {
root /etc/hyperglass/static/custom
}
file_server /images {
root /etc/hyperglass/static/images
}
reverse_proxy localhost:8001
}
3. The problem Iâm having:
Caddy has been running for over two months with no problem, but I needed to add a TLS cert. I copied the existing Caddyfile to old_Caddyfile and changed the tls directives, then tried to restart Caddy. It failed, so I deleted the Caddyfile and moved the old_Caddyfile back to Caddyfile, but caddy still will not start. Itâs using the exact same file I used to start it last time.
4. Error messages and/or full log output:
caddy start
2021/03/08 23:06:35.124 INFO using adjacent Caddyfile
run: adapting config using caddyfile: parsing caddyfile tokens for âtlsâ: Caddyfile:2 - Error during parsing: single argument must either be âinternalâ or an email address
start: caddy process exited with error: exit status 1
$ sudo systemctl status caddy
â caddy.service - Caddy
Loaded: loaded (/usr/lib/systemd/system/caddy.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2021-03-08 22:53:02 UTC; 2s ago
Process: 4609 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=1/FAILURE)
Main PID: 4609 (code=exited, status=1/FAILURE)
Mar 08 22:53:02 bblg-ho-01.sys.comcast.net systemd[1]: Started Caddy.
Mar 08 22:53:02 bblg-ho-01.sys.comcast.net systemd[1]: caddy.service: main process exited, code=exited, status=1/FAILURE
Mar 08 22:53:02 bblg-ho-01.sys.comcast.net systemd[1]: Unit caddy.service entered failed state.
Mar 08 22:53:02 bblg-ho-01.sys.comcast.net systemd[1]: caddy.service failed.
5. What I already tried:
I restored the original caddyfile and have tried restarting it using âcaddy startâ as well as âsystemctl start caddyâ, but there is no difference in the end result. It seems to be failing because of âtls offâ in the Caddyfile, but thatâs what was there when I started and it was working. I remember having difficulties getting this to work a couple of months ago, but I donât remember donât anything specific to make this work. Iâve looked back in my command history and donât see any clues to indicate I did anything special.