The Issue of the Day Before

安裝 Caddy2

install -

sudo apt install caddy

Why

caddy version 2vaersion 1 雖然功能沒太多升級,但卻有很大的差異。

caddy2 提供的官方的標準版。而不是 caddy1 的編譯版。

但若你需要第三方插件則可以使用 xcaddy

How

Install

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

Config

/etc/caddy/Caddyfile
:80 {
        root * /usr/share/caddy
        file_server
}
閱讀在雲端