1. Caddy version (caddy version
):
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
2. How I run Caddy:
a. System environment:
Debian 11
b. Command:
systemctl start caddy.service
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=www-data
Group=www-data
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
d. My complete Caddyfile or JSON config:
lastfree.space {
root * /home/storage/www/lastfree.space
php_fastcgi 127.0.0.1:9000
encode gzip
rewrite * /index.php?q={path}&{query}
file_server
log {
output file /var/log/caddy/lastfree.space.log
}
}
3. The problem I’m having:
I am trying to run Friendica using Caddy. It shouldn’t be difficult, but I can’t get the site up and running. I tried to find a ready-made Caddyfile for Friendica, but only found an obsolete configuration for Caddy 1:
server_name {
root /home/friendica/public
log /home/friendica/log/access.log
errors /home/friendica/log/errors.log
fastcgi / 127.0.0.1:2000 php {
env PATH /bin
}
rewrite {
r .*
to /{uri} /index.php?q={path}&{query}
}
}
I rewrote this for the Caddy 2 version, but it did nothing.
What works wrong: When you try to go to lastfree.space, it should go to lastfree.space/install and the initial installation should start. The transition happens, but the installation page is clearly distorted, no pictures are displayed. In the console - a huge number of errors.
My experience does not allow me to understand what the problem is, so please help the community. I am willing to provide all the necessary information quickly.