Liseva tsa Marang-rang
Seva ea sejoale-joale ea webo e nang le HTTPS e iketsang le tlhophiso e bonolo
Ho fumana le ho ntlafatsa li-certificate tsa SSL/TLS ho tsoa ho Let's Encrypt ntle le litlhophiso life kapa life
Mokhoa oa Caddyfile o balehang ke batho, o bonolo ho o ngola le ho o boloka, kapa JSON bakeng sa taolo ea lenaneo
Ts'ehetso ea tlhaho ea HTTP/2, HTTP/3 (QUIC), WebSocket, gRPC, le li-protocol tse ling tsa sejoale-joale
Reverse proxy e matla e nang le ho aba mojaro, ho hlahloba bophelo, li-circuit breaker, le failover e sebetsang le e sa sebetseng
Fumana li-certificate ka tlhoko bakeng sa lithepa tsa SaaS tse nang le mabitso a domain a bareki a likete
Loha litlhophiso ka bohlale ntle le ho lahla likhokahano kapa ho baka nako ea ho emisa
# Install Caddy from official repository
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
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
# Or download binary directly
curl -o caddy 'https://caddyserver.com/api/download?os=linux&arch=amd64'
chmod +x caddy
sudo mv caddy /usr/local/bin/
# Verify installation
caddy versionQalo e Potlakileng - Sebaka se Sa Fetoheng:# Create Caddyfile
cat > Caddyfile <<EOF
example.com {
root * /var/www/html
file_server
}
EOF
# Start Caddy
sudo caddy start
# Or run in foreground
sudo caddy runMohlala oa Reverse Proxy:cat > Caddyfile <<EOF
api.example.com {
reverse_proxy localhost:8080
}
EOF
sudo caddy run
# Simple static site with automatic HTTPS
example.com {
root * /var/www/html
file_server
encode gzip
}
# Reverse proxy to backend
api.example.com {
reverse_proxy localhost:3000
}
# Multiple backends with load balancing
app.example.com {
reverse_proxy localhost:8080 localhost:8081 localhost:8082 {
lb_policy round_robin
health_uri /health
}
}
# SPA with fallback
spa.example.com {
root * /var/www/spa
try_files {path} /index.html
file_server
}Likarolo tse Tsoetseng Pele:encode gzip zstd bakeng sa ho hatella ho beterefile_server {precompressed gzip br} bakeng sa lisebelisoa tse hatelletsoeng peleheader ho beha li-header tsa caching
Qala ka metsotsoana ka ts'ebetso ea rona e bonolo ea ho kenya VPS
Ho kenya ka ho ka bang 2 metsotso • Full root ho kena • Thuto ka terene le lengolo tsoibila