1. Caddy version:
v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=
2. How I installed, and run Caddy:
a. System environment:
Systemd, RPI4, Ubuntu Server
b. Command:
/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddy config:
{
https_port 443
admin off
order cgi before respond
}
chonkyrabbit.eu {
encode zstd gzip
# Website
handle_path / {
php_fastcgi unix//var/run/php/php8.1-fpm.sock
try_files {path} /index.html /index.php =404
root * /var/www/html
file_server
}
handle_path /data/* {
root * /var/www/html/data
file_server
}
# Private Fileserver
handle_path /files* {
root * /var/www/ftp/public
file_server {
hide _*
browse
}
}
# Public Fileserver
route /filebin* {
reverse_proxy localhost:8000
}
# Fiche
handle_path /lettermbox/* {
root * /var/www/lettermbox
file_server
try_files index.txt
}
# Git Old
route /git* {
uri strip_prefix /git
reverse_proxy localhost:3000
}
# Git New (DON'T FORGET TO EDIT THE CGIT CONFIG)
handle_path /cgit-resource* {
root * /usr/share/cgit/
file_server
}
handle_path /cgit* {
# xcaddy build --with github.com/aksdb/caddy-cgi/v2
cgi * /usr/lib/cgit/cgit.cgi
}
}
3. The problem I’m having:
Firstly, I just today switched from nginx to caddy, and I’m really impressed about it’s simplicity! I had it back up and running with almost no issues in a very short amount of time, where I would have faced many issues with nginx!
While the cgit homepage is now working correctly for the first time with caddy, I still can’ get cgit to detect the repo I clicked on, it always sais the file is not found.
Any idea why that could be? The repo path seems correct.
4 What I already trid
I tried stripping the url prefix “cgit”
Any help would be greatly appreciated!