1. Caddy version (caddy version
):
2.4.6
2. How I run Caddy:
As a service :
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.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
PrivateDevices=true
ProtectHome=true
ProtectSystem=full
Environment=CADDYPATH=/etc/ssl/caddy
AmbientCapabilities=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
--
a. System environment:
ubuntu 20.04 lts
b. Command:
systemctl start caddy
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.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
PrivateDevices=true
ProtectHome=true
ProtectSystem=full
Environment=CADDYPATH=/etc/ssl/caddy
AmbientCapabilities=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
--
d. My complete Caddyfile or JSON config:
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name}
flix.test.fr:8019 {
reverse_proxy * 127.0.0.1:8096
log {
output file /var/log/caddy/access.log
}
}
3. The problem I’m having:
Everything is fine but the /var/log/caddy/access.log file is empty (it has 777 r/w)
4. Error messages and/or full log output:
5. What I already tried:
I removed the log directive in the Caddyfile, same thing, as expected I suppose, empty access.log file.
I used the command
caddy fmt
and
caddy fmt --overwrite
no change. The status of the service
systemctl status caddy
caddy.service - Caddy
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-01-15 13:30:03 CET; 2s ago
Docs: https://caddyserver.com/docs/
Main PID: 734735 (caddy)
Tasks: 12 (limit: 38256)
Memory: 8.2M
CGroup: /system.slice/caddy.service
└─734735 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
janv. 15 13:30:03 fractal caddy[734735]: {"level":"info","ts":1642249803.4098778,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
janv. 15 13:30:03 fractal caddy[734735]: {"level":"warn","ts":1642249803.4107473,"msg":"input is not formatted with 'caddy fmt'","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":11}
janv. 15 13:30:03 fractal caddy[734735]: {"level":"info","ts":1642249803.414547,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
janv. 15 13:30:03 fractal caddy[734735]: {"level":"info","ts":1642249803.4146883,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
janv. 15 13:30:03 fractal caddy[734735]: {"level":"info","ts":1642249803.4147425,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00023a070"}