1. Caddy version (caddy version
):
caddy2 2.1.1-4 from aur
2. How I run Caddy:
a. System environment:
arch linux (5.7.10), systemd
b. Command:
sudo systemctl start caddy
c. Service/unit/compose file:
This is the service provided by the aur package
[Unit]
Description=Caddy webserver
Documentation=https://caddyserver.com/docs/
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
StartLimitIntervalSec=14400
StartLimitBurst=10
[Service]
User=caddy
Group=caddy
Environment=XDG_DATA_HOME=/var/lib
Environment=XDG_CONFIG_HOME=/etc
ExecStart=/usr/bin/caddy run --adapter caddyfile --environ --config /etc/caddy/caddy.conf
ExecReload=/usr/bin/caddy reload --adapter caddyfile --config /etc/caddy/caddy.conf
# Do not allow the process to be restarted in a tight loop. If the
# process fails to start, something critical needs to be fixed.
Restart=on-abnormal
# Use graceful shutdown with a reasonable timeout
KillMode=mixed
KillSignal=SIGQUIT
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
# Hardening options
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=strict
ReadWritePaths=/var/lib/caddy /var/log/caddy
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
LockPersonality=true
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
csos95.com, www.csos95.com, blog.csos95.com {
root * /var/www/blog/public
file_server
}
ssilva.work, www.ssilva.work {
root * /var/www/ssilva
file_server
}
csilva.dev {
root * /var/www/csilva
file_server
}
rss.csos95.com {
reverse_proxy localhost:2000
}
derpsin.space {
root * /home/csos95/dockerfiles/mastodon/public
file_server
encode gzip
header Strict-Transport-Security "max-age=31536000;"
header /emoji Cache-Control "public, max-age=31536000, immutable"
header /packs Cache-Control "public, max-age=31536000, immutable"
header /system/accounts/avatars Cache-Control "public, max-age=31536000, immutable"
header /system/media_attachments/files Cache-Control "public, max-age=31536000, immutable"
handle_errors {
rewrite * /500.html
file_server
}
@rewrite1 {
path /
}
rewrite @rewrite1 /proxy{path}
@rewrite2 {
not path /api/v1/streaming
}
rewrite @rewrite2 /proxy{path}
@websockets {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @websockets /proxy localhost:3000
}
wiki.csos95.com {
reverse_proxy localhost:4080
}
wallabag.csos95.com {
reverse_proxy localhost:5000
}
fimr.csos95.com {
reverse_proxy localhost:6000
}
git.csos95.com, gitlab.csos95.com {
reverse_proxy localhost:6080
}
write.csos95.com {
reverse_proxy localhost:8181
}
plex.csos95.com {
reverse_proxy localhost:32400
}
3. The problem I’m having:
The first three blocks with just root/file_server and the derpsin.space blocks do not work.
When I try to go to/curl those urls they return nothing.
4. Error messages and/or full log output:
There are no errors showing in sudo systemctl status caddy
and the /var/log/caddy
folder is empty.
If there’s a option I need to add to enable logging please let me know.
5. What I already tried:
I went through the docs and the migration guide and the blocks that are just reverse_proxy are working, but I can’t get any output at all when calling the others.